I do not really see how this makes sense. Default needs to be whatever phpBB default is (i.e., (British) English ATM), not whatever language the style author thinks should be the default.Unknown Bliss wrote:Maybe have the default language with a default suffix or default prefix?
[RFC] Style-specific language variables
-
- Registered User
- Posts: 27
- Joined: Wed Dec 21, 2011 5:34 pm
Re: [RFC] Style-specific language variables
Re: [RFC] Style-specific language variables
I think whole logic in that pull request is wrong.
Current logic:
1. Include forum's default language pack
2. If user's language pack is different from default, include it too
First of all, it doesn't check for template inheritance. Language variables are used only in templates, therefore template inheritance must apply to language files as well.
Second, why include two files? Second file will override first file, making first include pointless. I think translations should include all text, not only modified lines.
Third, what about English pack? Most styles include only English imageset. If a forum has default language different from English, point of default language pack will fail.
I think this would be correct logic:
1. Check if template inheritance is active, if it is go to #1a, if its not go to #2a
1a. Include user's language pack from original template if it exists
1b. If #1a failed, include forum default's language pack from original template
1c. If #1b failed, include English language pack from original template
2a. Include user's language pack for current template if #1a - #1c failed.
2b. If #2a failed, include forum's default language pack
2c. If #2b failed, include English language pack
That way only 1 file is included with bunch of elseif() checks.
Current logic:
1. Include forum's default language pack
2. If user's language pack is different from default, include it too
First of all, it doesn't check for template inheritance. Language variables are used only in templates, therefore template inheritance must apply to language files as well.
Second, why include two files? Second file will override first file, making first include pointless. I think translations should include all text, not only modified lines.
Third, what about English pack? Most styles include only English imageset. If a forum has default language different from English, point of default language pack will fail.
I think this would be correct logic:
1. Check if template inheritance is active, if it is go to #1a, if its not go to #2a
1a. Include user's language pack from original template if it exists
1b. If #1a failed, include forum default's language pack from original template
1c. If #1b failed, include English language pack from original template
2a. Include user's language pack for current template if #1a - #1c failed.
2b. If #2a failed, include forum's default language pack
2c. If #2b failed, include English language pack
That way only 1 file is included with bunch of elseif() checks.
Formerly known as CyberAlien.
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC] Style-specific language variables
Good point. I'll need to work on checking for template inheritance.Arty wrote:I think whole logic in that pull request is wrong.
Current logic:
1. Include forum's default language pack
2. If user's language pack is different from default, include it too
First of all, it doesn't check for template inheritance. Language variables are used only in templates, therefore template inheritance must apply to language files as well.
Fallback. What if the second file (user's language) does not include some of the variables used in the template, but they are present in the board default language file?Second, why include two files? Second file will override first file, making first include pointless. I think translations should include all text, not only modified lines.
English is default on new phpBB installations and must be present in all MODs (and therefore, now in any styles that include language variables). I do agree that if the board default is different from English it won't find the file if one is not present, but that is why it also checks for the user specified language as well.Third, what about English pack? Most styles include only English imageset. If a forum has default language different from English, point of default language pack will fail.
I'll think about this a bit more and work on trying to get template inheritance implemented.I think this would be correct logic:
1. Check if template inheritance is active, if it is go to #1a, if its not go to #2a
1a. Include user's language pack from original template if it exists
1b. If #1a failed, include forum default's language pack from original template
1c. If #1b failed, include English language pack from original template
2a. Include user's language pack for current template if #1a - #1c failed.
2b. If #2a failed, include forum's default language pack
2c. If #2b failed, include English language pack
Re: [RFC] Style-specific language variables
Those are style specific language packs, there is no reason for them not to include some variables.imkingdavid wrote:Fallback. What if the second file (user's language) does not include some of the variables used in the template, but they are present in the board default language file?
This is language pack for style, not for forum. When user installs language pack for forum, he always uploads language specific files, otherwise he wouldn't be able to install it. When user installs style, he expects it to just work and can't be bothered with going through style's files to create his custom language pack. That's why I think there should be ether "default.php" or it should fall back to English language pack.imkingdavid wrote:English is default on new phpBB installations and must be present in all MODs (and therefore, now in any styles that include language variables). I do agree that if the board default is different from English it won't find the file if one is not present, but that is why it also checks for the user specified language as well.
Formerly known as CyberAlien.
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC] Style-specific language variables
Alright, so I have updated my pull request to take template inheritance into account. It also now only includes one file at a time (or two if there is template inheritance), and falls back on english if neither the user language nor the board default language are present. And because it is not mandatory for styles to include language variables, there is no error if none of the files exists.
Re: [RFC] Style-specific language variables
Looks good
Formerly known as CyberAlien.
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
Re: [RFC] Style-specific language variables
What happened to this?
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"