[ZBX-4402] Gettext. Translation. Usage of context function. Created: 2011 Nov 29 Updated: 2017 May 30 Resolved: 2012 May 11 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 1.9.8 (beta) |
Fix Version/s: | 2.0.0rc4 |
Type: | Incident report | Priority: | Major |
Reporter: | Oleksii Zagorskyi | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 1 |
Labels: | context, gettext, translation | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | 1. pootle.png 2. virtaal.png 3. lokalize.png 4. poedit.png context1.diff | ||||||||
Issue Links: |
|
Description |
I decided to do the experiments and select the best style to write translatable strings in context with/without comments. Tested: Considered two different styles of source code. b) bottom of the picture: In the case a) I used short context definition ('page') and the comment for gettext. We need to discuss and select the best style regarding to save source code clear and to give for translators as much help as possible. My personal conclusion:
So I propose the style: See corresponding attached picture. According to the "best style" a patch prepared. Documentation will be updated: p.s. some bad comment was fixed in the patch: |
Comments |
Comment by Oleksii Zagorskyi [ 2012 Apr 27 ] |
The major application which should be taken into account first of all it's Pootle. A minor disadvantage of usage gettext comments "// GETTEXT:" (for Pootle) that it will replace information about source code where this string is used (see previously attached picture). So, I agree that would be better to avoid use the context && gettext-comment in the same time. Very short context (one word) also is not very good: less clear and less noticeable in the translation tool. Recommended length is 2-3 words. For that example (in issue summary) the code would be: Opinions? |
Comment by Oleksii Zagorskyi [ 2012 Apr 27 ] |
Note to devs: code lines: in the "frontend.po" visible like this: #. GETTEXT: r is date format string as described in http://php.net/date Note that that comment applied to the "Users (online)" string. See doc: http://www.zabbix.com/documentation/2.0/contrib/frontend_localisation#comments_for_translators It will be fixed in next suggested patch. |
Comment by Oleksii Zagorskyi [ 2012 Apr 28 ] |
New patch (according rules described above) attached. |
Comment by Alexey Fukalov [ 2012 May 03 ] |
dev branch: svn://svn.zabbix.com/branches/dev/ZBX-4402 |
Comment by Oleksii Zagorskyi [ 2012 May 03 ] |
Dev branch successfully tested. |
Comment by Oleksii Zagorskyi [ 2012 May 03 ] |
(1) See func.inc.php#201 to add context
<Vedmak> RESOLVED <zalex> It's correct solution and can be CLOSED, but here is some issue. Se regenerated Ukrainian PO file part: #: include/forms.inc.php:1538 include/func.inc.php:110 #: include/func.inc.php:222 As we see "Тра" (short version) stayed linked to the sting "May" (full version, without context) Rich, maybe this string somehow can be removed from PO files before synchronization with Pootle ? <richlv> yes, you could add that as another sub-problem comment here <zalex> CLOSED |
Comment by Oleksii Zagorskyi [ 2012 May 03 ] |
(2) -> to Rich |
Comment by Oleksii Zagorskyi [ 2012 May 03 ] |
(3) [Documentation] -> to Oleksiy <zalex> RESOLVED |
Comment by Oleksii Zagorskyi [ 2012 May 04 ] |
It seems |
Comment by Pavels Jelisejevs (Inactive) [ 2012 May 07 ] |
Just a thought: wouldn't it be better to make more general contexts instead of a lot of small ones? E.g: "units short" instead of "micro short", "mega short" etc. I also don't like that these contexts are literal strings: if we'll need to change them, we'll have to do a hell lot of editing and the cool autocomplete features won't be available. <zalex> I'm sure that "micro short" and "mega short" are better than "units short" because they also explain what they are (mega, micro, etc). <pavels> The only benefit I see from using more general contexts, is that they will be easier to document and follow, i.e. if I need to add a context string for "Mon", I would first check, if some short-day-related context already exists to be consistent with other translations. But that's just a thought, if you think that your approach is better, I'll trust you =). Forget the second question, it couldn't be done anyway: I missed one thing when I wrote it. <zalex> I see, it sounds logically, but as I said, I suppose we already have implemented almost all places where context should be used. So it almost unreal that it will worth to use more general context to avoid potential extra work for translators. |
Comment by Pavels Jelisejevs (Inactive) [ 2012 May 07 ] |
(4) We might as well remove the would-be constants from JS files. <pavels> Discussed it with vedmak: we can't right now. CLOSED. |
Comment by Toms (Inactive) [ 2012 May 07 ] |
(5) class.cserverinfo.php:43 "D, d M Y H:i:s O" could be used as constant, same in CXmlImport18.php:303&304 <Vedmak> RESOLVED <Toms> CLOSED |
Comment by Toms (Inactive) [ 2012 May 07 ] |
(6) CCanvas.php:73 home page also could be used as constant <Vedmak> RESOLVED <Toms> CLOSED |
Comment by Toms (Inactive) [ 2012 May 07 ] |
(7) jsLoader.php missing GNU licence <Vedmak> hmm, i have licence in that file. <Toms> Mistaken something. CLOSED |
Comment by Toms (Inactive) [ 2012 May 07 ] |
(8) "May short" could be written as "month May short", it would be easier to understand. <Vedmak> I think it's not needed, as then it will be inconsistent with other months and capital letter gives the hint that it's month. <Toms> CLOSED |
Comment by Oleksii Zagorskyi [ 2012 May 07 ] |
(9) [minor] Consider please to add contex to "Y": because "Y" is very short word, and maybe would be better to add context from very begging, just in case. <Vedmak> RESOLVED <zalex> Thanks, I'd say CLOSED |
Comment by Toms (Inactive) [ 2012 May 08 ] |
TESTED |
Comment by Alexey Fukalov [ 2012 May 08 ] |
svn://svn.zabbix.com/trunk 27340 |
Comment by Alexey Pustovalov [ 2012 May 08 ] |
#: events.php:479 include/actions.inc.php:71 <zalex> moved to ZBX-4988. |
Comment by Oleksii Zagorskyi [ 2012 May 11 ] |
Reopened to perform some service. |
Comment by Oleksii Zagorskyi [ 2012 May 11 ] |
Closed again |