Ticket: PHPBB3-13709
PR:
--------------------
I have run into email templates not being available (the add user extension) and if there are no email templates available for the users language then an error presents itself. If using extensions and that ext requires a lang file the core of phpBB should always revert to at least the en directory of the extension as that lang is always required for a validated extension.
--------------------
Final state: We should fall back to board default and then english to be coherent with the other parts of the software.
[RFC] Extension to fall back to en lang
[RFC] Extension to fall back to en lang
Last edited by RMcGirr83 on Wed Mar 18, 2015 4:59 pm, edited 1 time in total.
Do not hire Christian Bullock he won't finish the job and will keep your money
Re: [RFC] Extension to fall back to en lang
Here is a perfect example
The extension uses that path to include images for other languages.
Which uses this in the overall header event fileFatal error: Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template "../theme/en_us/profile_side_switcher.css" (looked into: ./styles/prosilver/template, ./styles/prosilver/theme) in "@tatiana5_profileSideSwitcher/event/overall_header_head_append.html"
Code: Select all
<!-- INCLUDECSS ../theme/{T_THEME_LANG_NAME}/profile_side_switcher.css -->
Do not hire Christian Bullock he won't finish the job and will keep your money
Re: [RFC] Extension to fall back to en lang
I think there are two other alternatives but I agree something should be done:
1) Fallback to an extension-specific 'default language' defined in composer.json (Accommodates non-english extensions better) or if that is not defined then fall back to
2) Look in the extension for language files and choose one at random (I don't think this is a good idea) although you could set it to look for the 'closest match' to the iso so the closest to
1) Fallback to an extension-specific 'default language' defined in composer.json (Accommodates non-english extensions better) or if that is not defined then fall back to
en
.2) Look in the extension for language files and choose one at random (I don't think this is a good idea) although you could set it to look for the 'closest match' to the iso so the closest to
en_us
would be en
.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"
- tumba25
- Registered User
- Posts: 14
- Joined: Sun Feb 01, 2009 10:13 pm
- Location: Kokkola, Finland.
- Contact:
Re: [RFC] Extension to fall back to en lang
1) Most extension users understands English. But in my case 'default language' should be Swedish or maybe Finnish. And I'm sure most users do not know either of those languages. I think it always should fall back to
Even if there is language files for some other language some last minute changes could have left one or more strings missing.
en
.Even if there is language files for some other language some last minute changes could have left one or more strings missing.
- DavidIQ
- Customisations Team Leader
- Posts: 1904
- Joined: Thu Mar 02, 2006 4:29 pm
- Location: Earth
- Contact:
Re: [RFC] Extension to fall back to en lang
CSS and other objects that are language specific should just default to en if they are not present in the language's folder since, as Rich already stated, we require
en
for validation.Re: [RFC] Extension to fall back to en lang
As for email templates, one thing they can do in the meantime is specify the 'en' language when setting the template
But yes, localized email templates and style files (css or images) needs a fallback, first to board default, then to 'en', as it does with other language files.
$messenger->template('@vendor_extname/my_email', 'en');
, because extensions are required to have "en". That would make them all English, but at least you won't get any errors.But yes, localized email templates and style files (css or images) needs a fallback, first to board default, then to 'en', as it does with other language files.
Has an irascible disposition.
Re: [RFC] Extension to fall back to en lang
Currently, we check for the users lang directory within the extension and if it doesn't exist display an error message. Workaround of sorts.
Do not hire Christian Bullock he won't finish the job and will keep your money
Re: [RFC] Extension to fall back to en lang
Only by our own (http://www.phpbb.com) customisations database validation policies, not by phpBB itself.VSE wrote:because extensions are required to have "en". That would make them all English, but at least you won't get any errors.
ISTs do have extensions and customisations posted on them and not all will have an English language pack, as might those on international 3rd party sites or developed by individuals/organisations for other usage.
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"
- DavidIQ
- Customisations Team Leader
- Posts: 1904
- Joined: Thu Mar 02, 2006 4:29 pm
- Location: Earth
- Contact:
Re: [RFC] Extension to fall back to en lang
Well it could be made into a more complex algorithm then where the default language ends up being the most used language on the board the extension is installed in if the case is that the user's language is not found in the extension package. This list would be compared against what languages the extension brought with it and then try to make a selection based on that list.
Re: [RFC] Extension to fall back to en lang
Ours is the only one that mattersMichaelC wrote:Only by our own (http://www.phpbb.com) customisations database validation policies, not by phpBB itself.
Has an irascible disposition.