Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: translation-string-format.md

Issue 29422615: Issue 5068 - Define translation string format (Closed)
Patch Set: Simplified proposed changes Created Sept. 22, 2017, 12:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Websites translation string format
2
3 ## Format
4
5 `{{ $uid[$context] $contents }}`
6
7 ### $uid (required)
8
9 Format
10 : >= 1 alphanumeric asic char
11
12 Exceptions
13 : Should be human readable if reused.
14
15 ### $context (optional - unnesisary for reuse)
16
17 Format
18 : Parent HTML tag and attribute name (if applicable)
19
20 Exceptions
21 : - Expand tag names e.g. "p" -> "paragraph"
22 - Exclude irrelivant information like heading number e.g. "h1" -> "heading"
23 - Provide functional context if applicable e.g. "title" -> "tooltip"
24
25 ### $content (optional - unnessisary for reuse)
26
27 Format:
28 : >= 1 UTF-8 char
29
30 Exceptions:
31 : Should not contain "}}"
32
33 ## Example
34
35 ```
36 <nav>
37 <h1>{{ brand-name[heading] Adblock Plus }}</h1>
38 ...
39 </nav>
40 <header>
41 <h1>{{ brand-name }}</h1>
42 <p>{{ 1[subtitle] Blocks annoying ads }}</p>
43 </header>
44 ...
45 ```
46
47 - Notice how "brand-name" is reused
48 - Notice how "1" has functional context
49 - Notice that "1" is a UID not an NID. It could just as easily be "a" or "9" as long as it's not used more than once on the page.
50
51 ## FAQ
52
53 Why not make all string IDs human readable?
54 : Because picky humans cannot generate or review them efficiently
55
56 Why not add location information to string contexts?
57 : Because [picky humans cannot generate or review them efficiently, we often be gin translation before implementation, we don't have a staging system to show vi sual context information].
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld