Load default language before other languages?

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Load default language before other languages?

Post by naderman »

We created a patch [1] for Forumatic to allow us to use incomplete language files without errors or missing output. Instead english is displayed in these places. The patch could be adjusted to load the default board language instead. At the same time this is a lot of overhead if the chosen language is actually complete, since both languages are completely loaded (although not kept in memory, since values overwrite each other). Do you think this is something we should add to phpBB or should we rather stick to having "{ L_MISSING_VAR }" output and errors if a key is used directly in the code?

[1] https://github.com/naderman/forumatic-p ... lish.patch

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: Load default language before other languages?

Post by brunoais »

We could do a "cachy" thing with this.
We could try creating singular files with the result of merging both languages (the en and the other language) for each language.
Basically, do with lang files what you do with template files. Cache 'em
I don't know how correct that is but it's a solution. The extra space used does not seem to be a problem. What do you think?

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Load default language before other languages?

Post by Oleg »

What prompted doing this patch in the first place?

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: Load default language before other languages?

Post by brunoais »

^
The missing values for the keys in the foreign language translations cause the key to be outputted instead of the value in english.

Jocelyn79
Registered User
Posts: 11
Joined: Mon Apr 04, 2011 12:42 pm

Re: Load default language before other languages?

Post by Jocelyn79 »

I like that idea of replacing missing values in the default language by the ones in english.
Does anyone know what are the effects on performance?

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: Load default language before other languages?

Post by brunoais »

^
I have a good clue on that. It's significant, if the forum is working for a medium or larger community.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Load default language before other languages?

Post by Oleg »

brunoais wrote:^
The missing values for the keys in the foreign language translations cause the key to be outputted instead of the value in english.
This much is obvious, the question is in what use cases does this situation arise?

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: Load default language before other languages?

Post by naderman »

Having added some language keys for a custom page in english, which I'd like to show up in english when using another language which I don't have a translation for yet.

Jocelyn79
Registered User
Posts: 11
Joined: Mon Apr 04, 2011 12:42 pm

Re: Load default language before other languages?

Post by Jocelyn79 »

The problem may also happen if you install a mod that adds new language keys.
Most mods deliver texts only in English, so unless you update all your other language files, "{L_MISSING_VAR}" will show when using a language other than English.

MartinTruckenbrodt
Posts: 171
Joined: Sun Jan 29, 2006 1:00 pm
Location: Germany
Contact:

Re: Load default language before other languages?

Post by MartinTruckenbrodt »

Hello,
I think this a very important feature request.
At least it should be used if there are additional MOD language files missing, At least this would be a great thing for the large add-ons like gallery, calendar and so on.

An older topic here to complete this topic about multi language (pack) boards: viewtopic.php?f=105&t=33528

Bye Martin
Advanced Block MOD 1.1.1 has been released! - Prevent spam on your phpBB3 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists! - My MODs

Post Reply