[WIP] [ticket/10780] Move colons from template files to language files. #730

Closed
wants to merge 3 commits into
from

Projects

None yet

6 participants

@maelsoucaze

For now, colons are hardcoded in template files (adm, prosilver & subsilver2). In some languages, a space is needed before it or it's possible that another symbol is used. For this reason, colons are better located in the language files.

Ticket related: http://tracker.phpbb.com/browse/PHPBB3-10780

PHPBB3-10780

maelsoucaze [ticket/10780] Move colons from template files to language files.
For now, colons are hardcoded in template files (adm, prosilver & subsilver2). In some languages, a space is needed before it or it's possible that another symbol is used. For this reason, colons are better located in the language files. *_COLON language key has been added when a language key is also used in another place without a colon.

PHPBB3-10780
1242669
@naderman
phpBB Forum Software member

As discussed on IRC:

  • indentation changes in language files should be avoided to simplify reading the diff
  • all language variables which got a colon in this patch should have a version with and without the colon, so it's easy for style authors to use the alternative if appropriate
  • duplicate language keys from multiple files with different values should not be combined into one key, instead create a new key for one of the values, and use the new variable in the respective places.
@maelsoucaze
  • Indentation changes will be reversed.
  • I think this change is a big mistake. But heh, we'll see if style authors will add this "non-colon version". There will be many new language keys for maybe nothing, and those language keys are not useful by default, just by assumption.
  • Those duplicate language keys will be restored and a new language key will be created for one, with the new variable in the respective places.
maelsoucaze added some commits Apr 16, 2012
maelsoucaze [ticket/10780] Move colons from template files to language files.
For now, colons are hardcoded in template files (adm, prosilver & subsilver2). In some languages, a space is needed before it or it's possible that another symbol is used. For this reason, colons are better located in the language files. *_COLON language key has been added when a language key is also used in another place without a colon.

PHPBB3-10780
c3c6f49
maelsoucaze [ticket/10780] Move colons from template files to language files.
For now, colons are hardcoded in template files (adm, prosilver & subsilver2). In some languages, a space is needed before it or it's possible that another symbol is used. For this reason, colons are better located in the language files. *_COLON language key has been added when a language key is also used in another place without a colon.

PHPBB3-10780
1e77a8e
@maelsoucaze

Updated. I'm so tired. :)

@nickvergessen
phpBB Forum Software member

Mael can you refer to a language that does not use colons and/or requires spaces before them?
I can't find a topic in the translation forum and don't really like this patch as it will increase the diff for updating a language extremly with just adding : every where.

@nickvergessen nickvergessen commented on the diff Apr 16, 2012
phpBB/language/en/acp/attachments.php
@@ -73,7 +77,6 @@
'CAT_WM_FILES' => 'Windows Media media files',
'CHECK_CONTENT' => 'Check attachment files',
'CHECK_CONTENT_EXPLAIN' => 'Some browsers can be tricked to assume an incorrect mimetype for uploaded files. This option ensures that such files likely to cause this are rejected.',
- 'CREATE_GROUP' => 'Create new group',
@nickvergessen
nickvergessen Apr 16, 2012

Intentional? Same for the other deleted keys?

@maelsoucaze
maelsoucaze Apr 17, 2012

Yep, those are double language keys.

@nickvergessen nickvergessen commented on the diff Apr 16, 2012
phpBB/language/en/acp/common.php
@@ -283,7 +290,7 @@
'RESYNC' => 'Resynchronise',
'RESYNC_FILES_STATS' => 'Resynchronise files statistics',
'RESYNC_FILES_STATS_EXPLAIN' => 'Recalculates the total number and size of files attached to posts and private messages.',
- 'RETURN_TO' => 'Return to…',
+ 'RETURN_TO_BREAK' => 'Return to…',
@nickvergessen
nickvergessen Apr 16, 2012

This seems wrong?

@maelsoucaze
maelsoucaze Apr 17, 2012

'RETURN_TO' is already used, it was a double language key. Nils asked me to preserve those double language keys when the content is not exactly the same. However, I do not see where this language key can be used.

For information, the language key is 'RETURN_TO' => 'Return to',.

  • styles/prosilver/template/jumpbox.html
<p></p><p><a href="{U_VIEW_FORUM}" class="left-box {S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {FORUM_NAME}</a></p>
<p></p><p><a href="{U_INDEX}" class="left-box {S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {L_INDEX}</a></p>
  • styles/prosilver/template/ucp_pm_message_header.html
<!-- IF S_VIEW_MESSAGE --><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF -->
@maelsoucaze

I don't know about other languages, but in French, a space is required both before and after all two- (or more) part punctuation marks and symbols, including : ; « » ! ? % $ #.

@p
p commented Apr 17, 2012

Please gist and/or pastebin the IRC discussion and/or summarize the problem and the proposed solution and pros and cons. Maybe create an RFC for these changes where they can be properly discussed.

The duplication of language keys specifically should be explained. Please include specific examples in your language that are not currently properly translated.

@maelsoucaze

I think I've already summed up the problem. Colons are hardcoded in template files (adm, prosilver & subsilver2) for now. In some languages, a space is needed before it. For example, in French, a space is required both before and after all two- (or more) part punctuation marks and symbols, including : ; « » ! ? % $ #. For this reason, colons are better located in the language files.

The IRC discussion is really not interesting, I'm just asking to Nils if I can proceed and he's okay, he thinks I am right and that the colons should be in the language files.

If you need concrete example because "in French, a space is required both before and after all two- (or more) part punctuation marks and symbols, including : ; « » ! ? % $ #" is not clear enough for you, okay, let's go:

  • Orphan attachments: 3 is translated Pièces jointes orphelines : 3 in French, with a space before and after the colon.
  • List subforum in parent-forum’s legend: O Yes O No is translated Lister le sous-forum dans la légende du forum parent : O Oui O Non in French, with a space before and after the colon.
  • Seriously, in English *: * is translated * : * in French, with a space before and after the colon.

So actually, all the changes in my patch are not currently properly translated in French, and I'm sure other languages. Pu a space before a sentence is wrong, language keys can be used without colons.

Pros:

  • Compatible with all the languages in the world.
  • Symbols have to be included in language files, no hardcoded in template files. Some symbols can be different in some languages, we don't know that, let's be safe.

Cons:

  • Many new language keys and many new template changes. But heh, that's why this change is done in 3.1.x and not in 3.0.x.
  • I don't like 'COLON' / {L_COLON} because we don't know if it works in RTL languages.

Concerning RFC, I posted there: http://area51.phpbb.com/phpBB/viewtopic.php?p=238341#p238341

@nickvergessen
phpBB Forum Software member

L_COLON should work just well in RTL
We do stuff like that several times.

If that is not acceptable, I'd vote to remove the : instead of adding tones of duplicates

@erikfrerejean

I'm with Nick, a big -1 one a change that introduces this much duplication for a very limited use case.

If the space is an issue why not simply add a space on the end of the original language entry for those languages that need it?
Or else change the : to {L_COLON} and have it customized through a single entry.

@naderman
phpBB Forum Software member

There is an RFC for this on area51 now, so let's please discuss it there: http://area51.phpbb.com/phpBB/viewtopic.php?f=84&t=42903

@bantu bantu closed this Aug 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment