Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from
Closed

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

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 10, 2012

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

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
@naderman
Copy link
Sponsor 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.

@ghost
Copy link
Author

ghost commented Apr 11, 2012

  • 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 2 commits April 16, 2012 23:47
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
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
@ghost
Copy link
Author

ghost commented Apr 16, 2012

Updated. I'm so tired. :)

@nickvergessen
Copy link
Contributor

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.

@@ -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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional? Same for the other deleted keys?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, those are double language keys.

@ghost
Copy link
Author

ghost commented Apr 17, 2012

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
Copy link
Contributor

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.

@ghost
Copy link
Author

ghost commented Apr 17, 2012

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
Copy link
Contributor

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
Copy link

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
Copy link
Sponsor 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
Labels
None yet
Projects
None yet
5 participants