[RFC] Extension to fall back to en lang

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
User avatar
RMcGirr83
Registered User
Posts: 360
Joined: Fri Mar 09, 2007 1:51 am
Contact:

[RFC] Extension to fall back to en lang

Post by RMcGirr83 »

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.
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

User avatar
RMcGirr83
Registered User
Posts: 360
Joined: Fri Mar 09, 2007 1:51 am
Contact:

Re: [RFC] Extension to fall back to en lang

Post by RMcGirr83 »

Here is a perfect example
Fatal 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"
Which uses this in the overall header event file

Code: Select all

<!-- INCLUDECSS ../theme/{T_THEME_LANG_NAME}/profile_side_switcher.css -->
The extension uses that path to include images for other languages.
Do not hire Christian Bullock he won't finish the job and will keep your money

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Extension to fall back to en lang

Post by MichaelC »

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 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
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
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

Post by tumba25 »

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 en.

Even if there is language files for some other language some last minute changes could have left one or more strings missing.
Image

Need a mod created/installed, other custom-coded solution or a server admin? https://tumba25.net

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1903
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC] Extension to fall back to en lang

Post by DavidIQ »

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.
Image

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: [RFC] Extension to fall back to en lang

Post by MattF »

As for email templates, one thing they can do in the meantime is specify the 'en' language when setting the template $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.

User avatar
RMcGirr83
Registered User
Posts: 360
Joined: Fri Mar 09, 2007 1:51 am
Contact:

Re: [RFC] Extension to fall back to en lang

Post by RMcGirr83 »

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

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Extension to fall back to en lang

Post by MichaelC »

VSE wrote:because extensions are required to have "en". That would make them all English, but at least you won't get any errors.
Only by our own (http://www.phpbb.com) customisations database validation policies, not by phpBB itself.

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
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1903
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC] Extension to fall back to en lang

Post by DavidIQ »

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.
Image

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: [RFC] Extension to fall back to en lang

Post by MattF »

MichaelC wrote:Only by our own (http://www.phpbb.com) customisations database validation policies, not by phpBB itself.
Ours is the only one that matters ;)
Has an irascible disposition.

Post Reply