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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: translation-string-format.md
===================================================================
new file mode 100644
--- /dev/null
+++ b/translation-string-format.md
@@ -0,0 +1,57 @@
+# Websites translation string format
+
+## Format
+
+`{{ $uid[$context] $contents }}`
+
+### $uid (required)
+
+Format
+: >= 1 alphanumeric asic char
+
+Exceptions
+: Should be human readable if reused.
+
+### $context (optional - unnesisary for reuse)
+
+Format
+: Parent HTML tag and attribute name (if applicable)
+
+Exceptions
+: - Expand tag names e.g. "p" -> "paragraph"
+ - Exclude irrelivant information like heading number e.g. "h1" -> "heading"
+ - Provide functional context if applicable e.g. "title" -> "tooltip"
+
+### $content (optional - unnessisary for reuse)
+
+Format:
+: >= 1 UTF-8 char
+
+Exceptions:
+: Should not contain "}}"
+
+## Example
+
+```
+<nav>
+ <h1>{{ brand-name[heading] Adblock Plus }}</h1>
+ ...
+</nav>
+<header>
+ <h1>{{ brand-name }}</h1>
+ <p>{{ 1[subtitle] Blocks annoying ads }}</p>
+</header>
+...
+```
+
+- Notice how "brand-name" is reused
+- Notice how "1" has functional context
+- 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.
+
+## FAQ
+
+Why not make all string IDs human readable?
+: Because picky humans cannot generate or review them efficiently
+
+Why not add location information to string contexts?
+: Because [picky humans cannot generate or review them efficiently, we often begin translation before implementation, we don't have a staging system to show visual context information].
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld