[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: 127
Joined: Thu May 20, 2010 4:01 am
Location: Brazil
Contact:

Re: [RFC] Style-specific language variables

Post by Vinny » Sat Jan 07, 2012 12:28 am

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 » Sat Jan 07, 2012 1:53 am

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
Registered User
Posts: 971
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Style-specific language variables

Post by Arty » Sat Jan 07, 2012 11:02 am

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.
Formerly known as CyberAlien.

Free phpBB styles | Premium responsive XenForo styles

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 » Sat Jan 07, 2012 11:54 am

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

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

Re: [RFC] Style-specific language variables

Post by Ger » Sat Jan 07, 2012 12:11 pm

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
Registered User
Posts: 971
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Style-specific language variables

Post by Arty » Sat Jan 07, 2012 5:16 pm

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
Formerly known as CyberAlien.

Free phpBB styles | Premium responsive XenForo styles

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 » Sat Jan 07, 2012 10:13 pm

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
Registered User
Posts: 971
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Style-specific language variables

Post by Arty » Sat Jan 07, 2012 10:39 pm

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.
Formerly known as CyberAlien.

Free phpBB styles | Premium responsive XenForo styles

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 » Sun Jan 08, 2012 4:15 pm

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 » Mon Jan 09, 2012 3:41 pm

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