Project

General

Profile

Actions

Bug #2199

closed

J16: system and user language is not selected

Added by nant about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
11 January 2011
Due date:
% Done:

100%

Estimated time:
1:30 h


Files

2199.patch (847 Bytes) 2199.patch krileon, 27 January 2011 20:16
Actions #1

Updated by krileon about 13 years ago

  • Subject changed from CB 1.3.1 language switching not compatible with J160? to J16: CB 1.3.1 language switching not compatible?
Actions #2

Updated by nant about 13 years ago

Ok - had a discussion with Beat and it looks like we need to address the following:

Joomla 1.6 lnaguage files no longer have the

<backwardLang>XXXXX </backwardLang>

Which most likely means there is no longer any Joomla 1.6 API call that returns the name of the default language in Joomla (for example CB on former Joomla 1.0/1.5 environments could identify that if the default language for Joomla was el-GR then then CB would need to look in 'greek' folders for greek cb language related files).

So for Joomla 1.6 (and maybe more future proof) CB 1.4 (?) language plugins would be better to be placed in iso code folder names - example en-GB for english, el-GR for greek, etc. This way CB could trigger off the Joomla language file (en-GB.xml):

<metadata>
   <tag>en-GB</tag>
</metadata>

value and not rely on former method.

I have performed 4 trials with variations of existing CB1.3.1 english language plugin to test current installer.

trial1
------
changes to existing CB 1.3 English language plugin:

All filenames remain as is:
+ index.html
+ english.xml
+ english.php
+ cbteamplugins_language.php
+ calendar-locals.js
+ admin_language.php
+ images /

Changes made:

in file english.xml:

Changed:
<name>english</name>

To:
<name>en-GB</name>

Results:
-------
Installation is fine.
All files are placed in a folder named en-gb
Deletion is also fine.

============================================================

trial2
------

changes to existing CB 1.3 English language plugin:

filename changes:
+ index.html
+ english.xml -> en-GB.xml
+ english.php
+ cbteamplugins_language.php
+ calendar-locals.js
+ admin_language.php
+ images /

Changes made:

in file en-GB.xml:

Changed:
<name>english</name>

To:
<name>en-GB</name>

Results:
-------

Installation filename `en-GB` (with .xml)
does not match main php file plugin
attribute `english` in the plugin xml file

==============================================================
trial3
------
changes to existing CB 1.3 English language plugin:

filename changes:
+ index.html
+ english.xml -> en-GB.xml
+ english.php
+ cbteamplugins_language.php
+ calendar-locals.js
+ admin_language.php
+ images /

Changes made:

in file en-GB.xml:

Changed:
<name>english</name>

To:
<name>en-GB</name>

and changed:
<filename plugin="english">english.php</filename>
to:
<filename plugin="en-GB">english.php</filename>

Results:
-------
Installation is fine.
All files are placed in a folder named en-gb
Deletion is also fine.

===============================================================

trial4
------
changes to existing CB 1.3 English language plugin:

filename changes:
+ index.html
+ english.xml -> en-GB.xml
+ english.php -> frontend_language.php
+ cbteamplugins_language.php
+ calendar-locals.js
+ admin_language.php
+ images /

Changes made:

in file en-GB.xml:

Changed:
<name>english</name>

To:
<name>en-GB</name>

and changed:
<filename plugin="english">english.php</filename>
to:
<filename plugin="en-GB">frontend_language.php</filename>

Results:
-------
Installation is fine.
All files are placed in a folder named en-gb
Deletion is also fine.

=========================================================================
trail5
------
changes to existing CB 1.3 English language plugin:

filename changes:
+ index.html
+ english.xml -> language.xml
+ english.php -> languages10.php
+ cbteamplugins_language.php
+ calendar-locals.js
+ admin_language.php
+ images /

Changes made:

in file language.xml:

Changed:
<name>english</name>

To:
<name>en-GB</name>

and changed:
<filename plugin="english">english.php</filename>
to:
<filename plugin="language">language10.php</filename>

Results:
-------
Installation is fine.
All files are placed in a folder named en-gb
Deletion is also fine.

Actions #3

Updated by nant about 13 years ago

Looks like both Beat and I (nant) feel that trial5 for CB is the proposed solution.

Based on that the following changes are also proposed for next CBSubs language plugin (and I guess GJ can also follow?):

changes to existing CB 1.3 English language plugin:

filename changes:
+ index.html
+ admin_english.php -> admin_language.php
+ english.php -> language.php
+ admin_english.php -> admin_language.php
+ cbpaidsubscriptions_english.xml -> cbsubs_language.xml
+ images /

Changes made:

in file cbsubs_language.xml:

Changed:
<name>CB Paid Subscriptions English</name>

To:
<name>CBSubs en-GB</name>

and changed:
<filename plugin="cbpaidsubscriptions_english">english.php</filename>
to:
<filename plugin="cbsubs_language">language.php</filename>

Actions #4

Updated by beat about 13 years ago

  • Assignee set to beat
  • Target version set to CB 1.4.0
  • Estimated time set to 1:30 h
Actions #5

Updated by krileon about 13 years ago

Proposing not altering language filenames (wouldn't this cause issues with previous language plugins?), but instead simply fixing the getCfg( 'lang' ) results. Due to error in REGEX the result included the full name instead of just the first segment "english (united kingdom)" for example instead of just "english".

Patch addresses REGEX issue and causes correct string to be provided "english". This keeps complete backwards and forward compatibility. Of course the name can be anything, but so too can the TAG returned by Joomla API, so risk is the same whether using "english" or "en-GB".

Regardless of what is decided, patch needs applied to resolve the REGEX bug so the correct language is returned.

Actions #6

Updated by krileon about 13 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 80 to 100
Actions #7

Updated by beat about 13 years ago

  • Subject changed from J16: CB 1.3.1 language switching not compatible? to J16: system and user language is not selected
  • Status changed from Resolved to Closed

r1375 implements proposed fix, but also applied to the 2nd instance of that regex, in the login function.

Actions

Also available in: Atom PDF