[RFC] Style-specific language variables

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
Vinny
Style Customisations
Style Customisations
Posts: 129
Joined: Thu May 20, 2010 4:01 am
Location: Brazil
Contact:

Re: [RFC] Style-specific language variables

Post by Vinny »

To be simple, I think the file should be in: styles/prosilver/theme/{LANG_ISO}/. Example:
  • styles/prosilver/theme/en/en.php for english
  • styles/prosilver/theme/es/es.php for spanish
  • styles/prosilver/theme/pt_br/pt_br.php for portuguese
  • ...
The language imageset are already located in this directory.

Each file must have the directory name of the language, like translating a MOD.

User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: [RFC] Style-specific language variables

Post by A_Jelly_Doughnut »

Vinny wrote:To be simple, I think the file should be in: styles/prosilver/theme/{LANG_ISO}/.
What's more simple about this than what David proposed? Particularly with the duplication (it seems that you can never have more than one file in the style/style_name/theme/lang_iso/ directory?
A_Jelly_Doughnut

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Style-specific language variables

Post by Arty »

Great idea, but I propose a slightly different structure (similar to second method in david's post + fallback):
  • styles/prosilver/lang/en.php
  • styles/prosilver/lang/de.php
  • styles/prosilver/lang/default.php
Why only one directory?

Few suggestions here put files in sub directories. There is only 1 file per language pack, no need to make multiple directories.

Why not store it with theme?

I think mixing php files with images and css is a bad idea. Nether template nor theme should not have any php files.

What is "default.php"?

Its a fallback php file that includes default (English) language pack. When including style specific language pack, if directory styles/{style}/lang exists, but there is no php file for current language pack, phpBB should include default.php. This way if style doesn't have language pack for current language, style will still work properly.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Style-specific language variables

Post by callumacrae »

Why not just default to English?
Made by developers, for developers!
My blog

User avatar
Ger
Registered User
Posts: 293
Joined: Mon Jul 26, 2010 1:55 pm
Location: 192.168.1.100
Contact:

Re: [RFC] Style-specific language variables

Post by Ger »

Arty wrote:What is "default.php"?

Its a fallback php file that includes default (English) language pack. When including style specific language pack, if directory styles/{style}/lang exists, but there is no php file for current language pack, phpBB should include default.php. This way if style doesn't have language pack for current language, style will still work properly.
Even better: always load default.php and also load lang_iso.php when it exists. That way, even when there are records in default.php that are omitted in lang_iso.php (due to an update for example), there'll always be something readeble instead of something like {TL_NEW_LANG_VAR}.
Above message may contain errors in grammar, spelling or wrongly chosen words. This is because I'm not a native speaker. My apologies in advance.

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Style-specific language variables

Post by Arty »

callumacrae wrote:Why not just default to English?
Some styles don't have English language pack, for example, some styles released on French phpBB website. With "default" main language pack could be French with English pack in en.php

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Style-specific language variables

Post by callumacrae »

Wouldn't it be better to have a file specifying the default, instead of having a duplicate file?
Made by developers, for developers!
My blog

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Style-specific language variables

Post by Arty »

Good point.

After thinking more about it, maybe just defaulting to en.php would be a better idea. All styles on phpbb.com required to have English language pack, so if style will include custom text it will have en.php. So never mind my suggestion, I think David's second suggestion is the way to go.

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

Re: [RFC] Style-specific language variables

Post by MichaelC »

Maybe have the default language with a default suffix or default prefix?
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
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Style-specific language variables

Post by imkingdavid »

Ticket

I have done some initial work on this, but if someone else is already working on this or wishes to do so, feel free to.

UPDATE: Actually, this turned out to be an easy feature. Pull Request
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Post Reply