Internationalization (i18n) formatting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Open Library |
Fix Released
|
Medium
|
Anand Chitipothu |
Bug Description
There are cases where Python (chiefly, commify) is included in a text string, and others where the text labels are being generated via Python and I'm not sure how to format the text in i18n strings so that it will be translatable. Examples:
In the search results page, the facet labels are generated from a script, but attempting to include the usual i18n envelope around the label is unsuccessful, the text and the envelope (i.e. $_("eBook?")) are all rendering. The same thing happens on the Work page for Subject labels.
On the same page, the number of results is being inserted in a text string at top, and the result is commified via Python. Rather than split the sentence into fragments, can we include the commify instruction in the i18n string?
Changed in openlibrary: | |
assignee: | nobody → Anand Chitipothu (anandology) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openlibrary: | |
status: | In Progress → Fix Released |
The i18n strings can take parameters. For example:
$:_("We found <strong>%s results</strong> that match your query.", commify(num_found))
The occurrences of %s will be replaced with the arguments in the specified order.
I've fixed commify to respect locale.
http:// upstream. openlibrary. org/search? q=book& lang=en upstream. openlibrary. org/search? q=book& lang=te
http://