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.
Good point. I'll need to work on checking for template inheritance.
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.
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?
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.
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.
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
I'll think about this a bit more and work on trying to get template inheritance implemented.