Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
(2013-06-22, 17:54:47)mvlcek Wrote:
(2013-06-21, 17:58:23)Draxeiro Wrote: Lately I've had various projects needing multi-language functionality and I'm starting to run into some snags concerning the workings of the i18n plugin.

Please correct me if I am wrong here but right now creation of pages in one of the additional languages is basically linked to the default language. If the page is not there in the default language it will not show in navigation of the additional language. Correct?
[quote='Draxeiro' pid='37538' dateline='1371801503']

Yes, the default language page is always required, e.g. parent and menu order are only defined there. The idea behind the initial version of the plugin was simply
  • there are no special language links
  • if the user's language settings list any other than the default language, check if the page exists in one of these languages and display it, otherwise display the default language.

[quote='Draxeiro' pid='37538' dateline='1371801503']
...
However, in every day practise the need is definitely there to be able to create pages exclusively in the non-default language. So in other words for the languages to have separate content.

I hope this is functionality you are willing to add to your plugin. As it would make it just about perfect.

I fear this would mean rewriting most of the plugin - especially the navigation part. I'll look into it, when I have some time.
Just out of interest, could something like this be a step in the right direction? (not for the navigation, but for displaying content only existing in one language)

PHP Code:
add_action('error-404''i18n_lang_page_only'); // 3.2.1+

function i18n_lang_page_only() {
  global 
$id$data_index;
  
$page glob(GSDATAPAGESPATH.$id.'*.xml');
  if (!empty(
$page)) {
    
$page $page[0]; // takes first existing page (regardless of language)

    // get page details from XML file (using SimpleXML or XML2Array) and output them to $data_index properties
  
}

Reply
In addition to my Enhancement request here, there is an anomaly between page titles and menu text in the Page Options section of Edit Page in the admin area.

With I18N enabled, the drop-down list for 'insert after' shows page titles, which is not at all intuitive where these differ from the menu text for a page.

Would it be possible to have this drop-down list show actual menu text (where it is different to page title), please?

Thanks for considering. ;-)
--
Nick.
Reply
Hello,

i have any question, is it possible so "enable / disable" language specified content?

Inside the standard menue i can only specify "delete" (x) not posible to mark as "disabale" or "inactive"
is there any solution exist that i can add content to the site and remove it form temp. time ?

Hope anyone has the same question or problem Wink

PHPman
Reply
Hi, I have a strange problem with the navigation menu
In the Admin I wiev all pages IN18
and when I change a name such as: (screen 1)
   
it is changed to wiev all pages IN18

but on the Edit Navigation Structure is the old name ... (screen 2)
   

Website template for a menuwhat i use is:
get_i18n_navigation (return_page_slug ());
the menu is displayed in the second screen However, every time when i change the name of the wiev all pages IN18 i must also change it manually in the Edit Navigation Structure
How do I fix this? Please help and sorry for I think a simple question.
Sory about my english,
user plugin: scroll to top
Reply
(2013-07-06, 01:38:03)xxdex Wrote: Hi, I have a strange problem with the navigation menu
In the Admin I wiev all pages IN18
and when I change a name such as: (screen 1)

it is changed to wiev all pages IN18

but on the Edit Navigation Structure is the old name ... (screen 2)

The Pages view shows the title, the navigation structure view the menu texts. If you change the title of a page, you should also change the menu text (in page options).
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hey mvlcek,

first: thank you very much for your plugins. They make my move from ModX to GetSimpleCMS very pleasant! Without them, I don't think I would have been able to use GSCMS at all - you added everything missing! :-)

I am very new to GSCMS so forgive me if I ask something obvious - a search in the forum didn't find anything:

I currently build a new website for myself (only local so far) and I am getting the following error:

( ! ) Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\Web\UwAmp\www\GetSimpleCMS\admin\inc\basic.php on line 562
Call Stack
# Time Memory Function Location
1 0.0003 170576 {main}( ) ..\index.php:0
2 0.0502 2166984 exec_action( ) ..\index.php:113
3 0.0502 2167016 call_user_func_array ( ) ..\plugin_functions.php:252
4 0.0502 2167112 sb_action_cron( ) ..\plugin_functions.php:252
5 0.0502 2167128 sb_cron( ) ..\simplebackups.php:41
6 0.0502 2167280 sb_log_debug( ) ..\cron.php:3
7 0.0502 2167360 sb_log( ) ..\log.php:19
8 0.0502 2167440 sb_load_thing( ) ..\log.php:3
9 0.0474 2153352 sb_load_xml_file( ) ..\data.php:18
10 0.0481 2181584 sb_log_warning( ) ..\data.php:63
11 0.0481 2181632 sb_log( ) ..\log.php:27
12 0.0481 2181680 sb_load_thing( ) ..\log.php:3
... those 4 rows then continue endlessly.

Now I went to the script the error mentioned and found that it is part of the GSCMS installation but deals with i18n, so I thought I ask here if this rings any bells. I am not very good (yet) at php debugging but maybe somebody here has a hint what I should look for?

I use the latest UwAmp as local server and everything else seems to run smooth.

I have english and german pages set up with i18n which also seemed to work fine so far.

Since it also happens on my splash-screen-page which doesn't have any menu etc. and just shows one image, I'm a bit lost what the problem could be.

Thank you very much!

Tom
Reply
Hi,

I define an I18N Custom Field called "link". When linking to a file (e. g. to a PDF) I'd like to open this file in target="_blank".

How can this be done?

Alex
Reply
(2013-07-10, 02:38:18)Thomas Helzle Wrote: I currently build a new website for myself (only local so far) and I am getting the following error:

( ! ) Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\Web\UwAmp\www\GetSimpleCMS\admin\inc\basic.php on line 562
Call Stack
# Time Memory Function Location
1 0.0003 170576 {main}( ) ..\index.php:0
2 0.0502 2166984 exec_action( ) ..\index.php:113
3 0.0502 2167016 call_user_func_array ( ) ..\plugin_functions.php:252
4 0.0502 2167112 sb_action_cron( ) ..\plugin_functions.php:252
5 0.0502 2167128 sb_cron( ) ..\simplebackups.php:41
6 0.0502 2167280 sb_log_debug( ) ..\cron.php:3
7 0.0502 2167360 sb_log( ) ..\log.php:19
8 0.0502 2167440 sb_load_thing( ) ..\log.php:3
9 0.0474 2153352 sb_load_xml_file( ) ..\data.php:18
10 0.0481 2181584 sb_log_warning( ) ..\data.php:63
11 0.0481 2181632 sb_log( ) ..\log.php:27
12 0.0481 2181680 sb_load_thing( ) ..\log.php:3
... those 4 rows then continue endlessly.

Now I went to the script the error mentioned and found that it is part of the GSCMS installation but deals with i18n, so I thought I ask here if this rings any bells. I am not very good (yet) at php debugging but maybe somebody here has a hint what I should look for?

Sorry for the noise, it has been some incompatibility with another plugin it seems. I disabled everything I don't need and now it works again.

Cheers,

Tom
Reply
How can I make the external links open in a new window (_blank)? I've searched through the boards and documentation but I can't find the way it's done...
Reply
(2013-07-14, 08:30:48)bensayers Wrote: How can I make the external links open in a new window (_blank)? I've searched through the boards and documentation but I can't find the way it's done...

You would need to use Custom rendering and add the target to the <a>, when the link is external.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Installation of internal links added lang
Reply
(2013-07-14, 17:19:00)mvlcek Wrote: You would need to use Custom rendering and add the target to the <a>, when the link is external.

OK thank you, would you be able to provide the code to make that work? I only want the external links to open in a new window, not all of them...
Reply
Mvlcek, I've got a question in regards of setting PHPSESSID cookie.
Is there a way to get rid of it while using i18n plugin only for advanced navigation purposes ?

I wouldn't ask if this freakin EU cookie law wasn't enforced, and everyone is freaking out.
Addons: blue business theme, Online Visitors, Notepad
Reply
(2013-07-18, 19:13:11)yojoe Wrote: Mvlcek, I've got a question in regards of setting PHPSESSID cookie.
Is there a way to get rid of it while using i18n plugin only for advanced navigation purposes ?

Between the UK Information Commissioner's Office and this EU Opinion document, my opinion is that you (and your clients) don't need to worry about PHPSESSID in your use case.

Now you just have to educate your clients! ;-) That EU document should be available in all the EU languages, if you need it – just change the two-letter language code in the document filename.

Pretty well any first-party cookies can be justified quite easily, so I think you need a solution for asking user permission, rather than trying to stop setting all cookies.

If your clients' sites have links to Twitter, Facebook, G+, etc., that's a far bigger concern than a session cookie.
--
Nick.
Reply
Hi all!
I like the I18N plugin and I use it even for a single language webpages, because of its comfortable page management (I use it with the parameter "define('I18N_SINGLE_LANGUAGE',true);" in gsconfig.php).
I also use fancy URL's and from the menu everything works fine.

However, when I use links to local pages in CKEditor, the additional parameter lang=cs, appears in the URL. (The same happens when I open any page thru # icon in Page Management.)
Is there a way how to get rid of the lang parameter even in these situations?

Thanx in advance
Petr
Reply
I18N version 3.2.3:
  • uses a language cookie instead of a session - the (session) cookie is only created, if the visitor clicks a setlang-URL and it clearly contains only the desired language (@Yojoe)
  • no language is added in internal links added in the editor, unless the fancy URL requires so (@blackeye)
  • no language is added in the page view links in the administration, if I18N_SINGLE_LANGUAGE is set and true (@blackeye)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
how were you adding it to the cke links ? just curious since I plan on rewriting that entire functionality soon, and have not considered that it could break a plugin.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
(2013-07-19, 04:54:44)shawn_a Wrote: how were you adding it to the cke links ? just curious since I plan on rewriting that entire functionality soon, and have not considered that it could break a plugin.

The whole CKEditor integration is a mess, e.g. it's necessary to copy the whole code to include an editor for a custom field. In this case, some analysis of the Javascript resulted in the following code to change the page list:
Code:
<script type="text/javascript">
  //<![CDATA[
  // modify existing Link dialog
  CKEDITOR.on( 'dialogDefinition', function( ev ) {
    if ((ev.editor != editor) || (ev.data.name != 'link')) return;

    var definition = ev.data.definition;
    var infoTab = definition.getContents('info');
    
    for (var i=0; i<infoTab.elements.length; i++) {
      var element = infoTab.elements[i];
      if ('id' in element && element.id == 'localPageOptions') {
        element.children[0].items = <?php echo json_encode($pages); ?>;
      }
    }
  });
  //]]>
</script>
where $pages is the array of page text/link tuples.

If you change the CKEditor integration, you should create a function addEditor($id), which creates the editor as replacement for the textarea with id $id. Add some hooks to allow plugins to provide an alternative page list, an image selection window, add buttons, etc. - this would make a plugin author's life easier ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I certainly will be, In fact I already moved that code to config.js in 3.2.3, so i can replace it with a popup page browser.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
(2013-07-18, 19:52:14)hameau Wrote: Now you just have to educate your clients! ;-) That EU document should be available in all the EU languages, if you need it – just change the two-letter language code in the document filename.

Pretty well any first-party cookies can be justified quite easily, so I think you need a solution for asking user permission, rather than trying to stop setting all cookies.

If your clients' sites have links to Twitter, Facebook, G+, etc., that's a far bigger concern than a session cookie.
I don't need any permissions from users. I need - as you said - to let them know that website does utilise cookies, and what are their purposes.
Anyway, it wasn't about the law. It was about by i18n plug setting a cookie with no certain purpose (no multilang content).
No cookie = no problem with sick EU cookie law Smile

Mvlcek: huge thanks for update!
Addons: blue business theme, Online Visitors, Notepad
Reply
(2013-07-19, 03:44:27)mvlcek Wrote: I18N version 3.2.3:
  • uses a language cookie instead of a session - the (session) cookie is only created, if the visitor clicks a setlang-URL and it clearly contains only the desired language (@Yojoe)
  • no language is added in internal links added in the editor, unless the fancy URL requires so (@blackeye)
  • no language is added in the page view links in the administration, if I18N_SINGLE_LANGUAGE is set and true (@blackeye)

Thanks a lot, that was really quick. Smile
But, is the new version already finished or is it still in progress?
In fact, there's still version 3.2.2 on the plugin page.

Thanks
Reply
(2013-07-21, 02:14:34)blackeye Wrote: Thanks a lot, that was really quick. Smile
But, is the new version already finished or is it still in progress?
In fact, there's still version 3.2.2 on the plugin page.

Thanks for the info. Somehow my upload didn't seem to work :-(
Reuploaded it.

@shawn_a: when updating a plugin in Extend, the earliest GS version is required, but it is not stored.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
edit: nm

Yeah i always noticed that I thought it was something chris did on purpose to force you to do it everytime.
Its stored, its just not restored in the form.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
(2013-07-21, 02:29:05)shawn_a Wrote: http://get-simple.info/extend/plugin/i18n/69/
Says 3.2.3 to me
You might have been seeing a cached version, extend is cached.

No, I was quicker. Don't know why it didn't upload - I probably didn't see the error message, when it requires the min. GS version. If I enter it, it's fine - but the version is not stored and I have to enter it again next time.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2013-07-21, 02:28:22)mvlcek Wrote:
(2013-07-21, 02:14:34)blackeye Wrote: Thanks a lot, that was really quick. Smile
But, is the new version already finished or is it still in progress?
In fact, there's still version 3.2.2 on the plugin page.

Thanks for the info. Somehow my upload didn't seem to work :-(
Reuploaded it.

@shawn_a: when updating a plugin in Extend, the earliest GS version is required, but it is not stored.

Excelent, now it works fine.
Thnx
Reply




Users browsing this thread: 9 Guest(s)