[ZBX-3271] gettext - implement context function Created: 2010 Dec 09 Updated: 2017 May 30 Resolved: 2011 Nov 14 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 1.9.1 (alpha) |
Fix Version/s: | 1.9.8 (beta), 2.0.0 |
Type: | Incident report | Priority: | Blocker |
Reporter: | Oleksii Zagorskyi | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | localization | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
latest trunk with Gettextization. |
Description |
Before gettextization we have: English locale: Now after gettextization the uptime format in web-interface with Ukrainian locale is wrongly presented as "2? 16? 2?" instead of "2? 16? 2?" I found a few locales in which this problem will be noticeable. Therefore, the new approach requires you to rethink where there can be problems also. I fast found some one duplicates again: 'S_LAST'=> 'Last', |
Comments |
Comment by Oleksii Zagorskyi [ 2010 Dec 28 ] |
I tried some modification: Result: As Richlv said - "currently not supported" in the So, perhaps is time to write this function _x() and I will make some patches to fix step by step problems i described in the Description? |
Comment by Oleksii Zagorskyi [ 2011 Aug 29 ] |
I would ask to perform this issue ASAP. Because we need additional time before the 2.0 release to figure out all possible places where this problem can be visible. For instance, try to open calendar in the Russian locale and see to the day's names . After implementing this function I'll be ready to try find such places and prepare the patches. |
Comment by Pavels Jelisejevs (Inactive) [ 2011 Nov 04 ] |
I believe there are 2 ways we can solve this: Secondly, do we need another _x() function? Maybe we can introduce a single universal wrapper, like __($string, $args = array(), $context = 'main')? |
Comment by Oleksii Zagorskyi [ 2011 Nov 04 ] |
I vote for the way #1 Multiple .po files will be not very convenient for translators too. For short messages like "m, h, s" you can write the special gettext comments in the source code, and they will be automatically included in the .po files and will be visible for translators in the Pootle, and in the other applications for translation. If I understand correctly the function _x() would be better (more convenient) than universal wrapper. |
Comment by richlv [ 2011 Nov 04 ] |
the problem is that 2. alone would not be enough - many terms will have context based on where they appear in the frontend, which would be impossible to realistically cover with categories. categories also seem like really complicate thing to maintain (although i haven't used such approach before). so i'd vote for 1. as for function, we currently use this approach with _s and _n, thus it kinda makes sense to be consistent. also, gettext tools recognise and parse such things outofthebox - not sure how a different wrapper scheme could be used - haven't tried that before either <pavels> What do you mean not enough? Both 1. and 2. will provide exactly the same functionality, they will assign a string to a single context. The only question is, how will we store them. I'm not sure we actually need folders, because, from my previous website i18n experience, very few terms actually need separate context (mostly shortenings and rare homonyms). If you don't think, that organizing translations in separate folders would be more convenient from translations, then it's probably not worth the effort. <zalex> |
Comment by Pavels Jelisejevs (Inactive) [ 2011 Nov 09 ] |
Ok, if everyone votes for #1, #1 it is. |
Comment by Pavels Jelisejevs (Inactive) [ 2011 Nov 10 ] |
Seems to be working fine. RESOLVED. |
Comment by richlv [ 2011 Nov 10 ] |
for the record, available in svn://svn.zabbix.com/branches/dev/ZBX-3271 (1) http://www.zabbix.com/documentation/2.0/contrib/frontend_localisation#disambiguation_by_context should be reviewed and updated, if necessary <pavels> CLOSED. |
Comment by Alexey Fukalov [ 2011 Nov 14 ] |
(2) [GUI] <pavels> CLOSED. |
Comment by richlv [ 2011 Nov 14 ] |
(3) added _xn parsing for po updating script - please, review <pavels> CLOSED. |
Comment by Pavels Jelisejevs (Inactive) [ 2011 Nov 14 ] |
Merged to trunk revision r23195. CLOSED. |