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: First draft Created April 26, 2017, 11:28 a.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,67 @@
+# Translation string format
saroyanm 2017/06/01 12:07:25 I think it makes sense to define if this document
juliandoucette 2017/06/07 16:07:39 Acknowledged. I don't know how translations are d
ire 2017/06/08 11:18:34 It would be really helpful to include some example
juliandoucette 2017/06/08 21:07:51 Acknowledged.
Lisa 2017/06/09 14:14:47 Totally agree with Ire.
saroyanm 2017/06/13 09:48:27 Yes, I also agree with you. Suggestion: I think e
saroyanm 2017/06/13 09:48:27 I think strings are very similar to what we have,
+
+`{{identifier[context] content }}`
+
+## Brackets
saroyanm 2017/06/01 12:07:25 Suggestion: I think "required" can go right next t
juliandoucette 2017/06/07 16:07:39 Acknowledged. Good point.
+
+Two curly braces must (required) go at the beginning and end of a translated string in Markdown and HTML format.
saroyanm 2017/06/01 12:07:26 Suggestion: I think from "must" it's obvious that
juliandoucette 2017/06/07 16:07:39 Acknowledged. I guess I thought this made it more
ire 2017/06/08 11:18:34 I think, as Manvel suggested later in this doc, th
juliandoucette 2017/06/08 21:07:51 Acknowledged.
+
+## Identifier
+
+An identifier must (required) immediately follow two opening brackets.
+
+- An identifier may identify only one string on one page
saroyanm 2017/06/01 12:07:26 Word "may" sound "balanced" for me, let me know if
juliandoucette 2017/06/07 16:07:39 "may" means *can*. "should" means *preferably*. "s
saroyanm 2017/06/13 09:48:27 In this context I understand wording this way: * M
+- If one string occurs more than once on one page in the same context, the same identifier may be used and the string context and content may be omitted
+- An identifier may contain only lowercase latin letters and dashes
saroyanm 2017/06/01 12:07:26 Suggestion: We can make this more strong. "should"
juliandoucette 2017/06/07 16:07:38 See comment above.
saroyanm 2017/06/13 09:48:28 same as the comment above.
+
+### Identifier format
+
+`summary-context-number`
+
+**Summary**
+: An identifier summary should describe the contents of the string or it’s parent heading in as few words as possible.
saroyanm 2017/06/01 12:07:26 Note: and example here I think could make things b
juliandoucette 2017/06/07 16:07:39 Acknowledged.
Lisa 2017/06/09 14:14:47 We should include an example. Personally, I'd like
juliandoucette 2017/06/09 15:13:54 You just taught me something :)
+
+**Context**
+: An identifier context should describe context in which the string appears in HTML. e.g. {h: heading, p: paragraph, li: list item}
juliandoucette 2017/05/18 08:54:37 Note: We have had a policy about spelling things o
saroyanm 2017/06/01 12:07:25 I think if we agree with this approach this can be
juliandoucette 2017/06/07 16:07:39 Good point. I think there is a middle ground here.
juliandoucette 2017/06/07 16:16:18 I'm afraid this was unclear. What I mean is that t
saroyanm 2017/06/13 09:48:28 I agree with you. Would be great to come up with t
+
+**Number**
+: A number should uniquely identify an identifier among other similar identifiers. e.g. among multiple consecutive list items or paragraphs with the same identifier summary and context.
juliandoucette 2017/05/18 08:54:37 Note: A number is not necessary if there are not m
saroyanm 2017/06/01 12:07:25 Having number "required" will minimize the effort
juliandoucette 2017/06/07 16:07:38 I agree. I found it awkward to use and/or not use
+
+## Context
saroyanm 2017/06/01 12:07:25 Suggestion: Let's mark optional here rather than i
juliandoucette 2017/06/07 16:07:39 Acknowledged.
+
+A Context should (optional) immediately follow an identifier.
+
+- Context must be enclosed within square brackets
+- Context may contain upper and lower case latin letters, dashes, commas, apostrophes, and spaces
+
+### Context format
+
+A Context should (optional) describe the HTML context (e.g. heading / paragraph / list item) and meaning (e.g. “Order” as in “place an order” or “Order” as in “Order of events”) of the string contents.
+
+## Content
+
+- A string’s content must (required) be separated from its identifier and context by one space
+- A string’s content should (optionally) be separated from it’s closing braces by one space
saroyanm 2017/06/01 12:07:26 Doesn't it mean that space should also being appli
juliandoucette 2017/06/07 16:07:39 I didn't know that we could put a space before the
ire 2017/06/08 11:18:34 I also prefer the first option. But I think we sho
juliandoucette 2017/06/08 21:07:51 Acknowledged.
+- A string must not (required) contain two closing brackets
+- An English string should (optional) not contain non-ascii characters
+
+## Jinja2 format translation strings
ire 2017/06/08 11:18:34 NIT: It's a bit confusing here to start talking ab
juliandoucette 2017/06/08 21:07:51 Acknowledged.
+
+`{{ ”content” | translate(“identifier”, “context”) }}`
+
+Jinja2 (.tmpl) format strings are made up of the same parts (identifier, context, content) in a different format (Jinja2 filter format). The same rules apply to each part, except that the identifier and context must be surrounded by double quotes.
+
+## Fixed tags
+
+`<fix>text</fix>`
+
+Fixed tags may (optional) appear within string contents. They are meant to identify parts of a string that may not be translated in some languages.
+
+- Fix tags must be closed
+- A fix tag may be manually overriden by translations
+
+### Common uses
ire 2017/06/08 11:18:34 Can we have a rule on whether the company name and
juliandoucette 2017/06/08 21:07:51 Acknowledged. I guess "optional" and "common uses
ire 2017/06/09 06:50:11 Yes, you're right. I was referring to the latter t
+
+- numbers
+- dates
+- names (people, brands, products)
ire 2017/06/09 06:50:11 Also, is there a rule on whether "eyeo", "Adblock
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld