June 05, 2023, 12:18:36 AM
Welcome, Guest. Please login or register
News: Join us for a FREE Webinar this Thursday at http://webinar.digitalsignage.com

MediaSignage support forum



Author Topic: Studio Lite language not working 1.1.40 dev-build  (Read 10787 times)

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Studio Lite language not working 1.1.40 dev-build
« on: October 14, 2014, 05:49:04 AM »
I installed the 1.1.40 dev-build on my webserver. Unfortunately I am unable to choose a different language. Besides, if I change the text in the file local-en.json it doesn't change any text in the studio lite (removed cache etc.). In earlier versions there were also more languages available in the _lang folder.

How can I make the studio lite use the json files in the _lang folder?

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5173
  • Karma: +36/-8
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #1 on: October 14, 2014, 08:27:24 AM »
StudioLite now uses a backend service as a central point for all localization. The benefit of this is that if we fix let's say French, everyne gets the imrpoved syntax as the localization is in the cloud. If you wish to change the localization to local you will have to edit source files such as:

Code: [Select]
\_common\_js\localizer\dist\jquery.localize.js
and you can uncomment:

Code: [Select]
// if (1) { // enable to test localization in dev env
if (window.location.href.indexOf('dist') > -1) {

the first line and comment second line...

also, the reason it may not work for you if you changed the URL of the installer which looks for the 'dist' in the http path, such as:

Code: [Select]
if (window.location.href.indexOf('dist') > -1) {
« Last Edit: October 14, 2014, 08:29:39 AM by admin »

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #2 on: October 14, 2014, 10:26:12 AM »
Thanks for your fast response and clear instructions. I'm going to look into this.

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #3 on: October 15, 2014, 01:13:37 AM »
Unfortunately I cannot fix the language. I have downloaded the zip from github and placed the files in _studiolite-dev directory.
The studio is working fine, I can also change languages using the select language tab.

I editted the jquery.localize.js like this:
Code: [Select]
if (1) { // enable to test localization in dev env
            // if (window.location.href.indexOf('dist') > -1) {

But, this does not change anything, I can still change languages using the select language tab (should not be possible I suppose?) and it doesn't use the local language file.

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5173
  • Karma: +36/-8
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #4 on: October 15, 2014, 10:19:50 AM »
let me ask, why are you trying to fix the lang? to make corrections?
if so, please provide us with all changes and we will make in them in the central DB so everyone gets the benefit of the  translations.

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #5 on: October 15, 2014, 12:23:08 PM »
Thanks for your reply.

My intention is to provide you guys with the translation for the central DB. But, I want to see the translation in action first, because it's not flawless yet, therefore I have to fix the language locally.

The reason why I want to fix the language is because I want to control the translation and I don't want the central DB to control it.
At this moment I'm going to take a sort of 'snapshot' from the current Lite version and want to do some devolopment.
I'm not interested in weekly updates, that's why I don't link it to the Github in real-time (and that's also why I don't want to link the language to the central DB).
After some developing and ofcourse contributing to the lite version where ever I can (for instance translating), I will make one big update (instead of many small ones soon after each other).

Hopefully my intentions are clear now. Could you point me in the right direction so I can fix the language (I have looked for other source files that has to be editted in order to use local language file, but I cannot find any)? I also want to use this version to collect feedback from different users to improve the translation, so it's important it's fixed.


admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5173
  • Karma: +36/-8
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #6 on: October 15, 2014, 01:04:59 PM »
you should be able to do the:

Code: [Select]
if (1) {I posted above, but you will also need to create translation files, look at _lang/local-en.json
so for example for french, create a file called _lang/local-fr.json

as well as adding the proper tags in the HTML file if you don't see what you expect as in studiolite.html:

Code: [Select]
<li><a href="#"><img class="flag" src="_assets/flags/fr.png" alt=""/>French<span class="value">fr</span></a>


JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #7 on: October 16, 2014, 09:34:54 AM »
Thanks for your reply,

I did as you posted above:
Code: [Select]
/* in distribution mode load through web service */
            if (1) { // enable to test localization in dev env
          //  if (window.location.href.indexOf('dist') > -1) {
                pepper.getLocalization(lang, function(e){
                    var d = e['studiolite'];
                    $.extend(intermediateLangData, d);
                    notifyDelegateLanguageLoaded(intermediateLangData);
                    return loadLanguage(pkg, lang, level + 1);
                });
            } else {

                // in development mode load through local file (english only supported)
                lang = 'en';
                file = 'local-en.json';
                var ajaxOptions, errorFunc, successFunc;
etc.

Besides, I can see all the flaggs and languages in the drop down menu. In the studiolite.html there already are tags like the one you posted under:
Code: [Select]
<!-- Language selection template -->
But, whenever I choose a language I am still able to choose languages I have not put in the _lang folder. Currently I only have local-en.json (already in there) and added a local-nl.json for the translation. But whenever I choose another language, for instance France, I still see the France translation from the central DB. Also the dutch language is still from the DB, not locally. I think the localization is not working. Also I tried editting the local-en.json file, but this won't make any changes to the text either.

Please advice.
« Last Edit: October 16, 2014, 10:00:55 AM by JMH »

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5173
  • Karma: +36/-8
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #8 on: October 16, 2014, 10:17:53 AM »
remove the lang u don't want from html file

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #9 on: October 16, 2014, 10:46:07 AM »
I removed the lang I don't want (all but dutch), but this still gives me the translation from the central DB not from the local-nl.json in the _lang folder I made (it does start with the dutch translation though).
I think this is very weird, because it shouldn't be able to find the lang on the central DB since I editted the jquery.localize.js.
« Last Edit: October 16, 2014, 10:48:59 AM by JMH »

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5173
  • Karma: +36/-8
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #10 on: October 16, 2014, 02:22:23 PM »
what if you change english? it changes?

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #11 on: October 16, 2014, 11:53:41 PM »
It doesn't change when I change English. I send you my installation URL over the mail, perhaps it will give you more information. Thanks.

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #12 on: October 20, 2014, 04:25:49 AM »
Do you have any idea what's causing the translation to keep using the central DB? I've got the feeling we are close to solving this issue, but I'm running out of ideas.

JMH

  • Sr. Member
  • ****
  • Posts: 203
  • Karma: +4/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #13 on: October 21, 2014, 11:07:57 AM »
Admin, could you kindly advise? I really hope I can use the dev function in order to load translation locally. It's almost impossible for me to make good translations based on just the json, whithout seeing in what situation the translation will be used. Besides I am unable to make people check the translation if it's not in a working setting.

Does the lang change when you change the localization to local?

I would really like to start translating, so I can contribute to the open source version  :)

update:
I believe I got it fixed (gonna find out if it automatically loads the local language now).

I looked at the localizer.json from the version I still had that loads local lang. Than I editted the current localization file to the following:
Code: [Select]
if (1) { // enable to test localization in dev env
            // if (window.location.href.indexOf('dist') > -1) {
                file = "" + options.pathPrefix + "/" + file;
            }
                successFunc = function(d) {
                    $.extend(intermediateLangData, d);
                    notifyDelegateLanguageLoaded(intermediateLangData);
                    return loadLanguage(pkg, lang, level + 1);
                };
                errorFunc = function() {
                    if (options.fallback && options.fallback !== lang) {
                        return loadLanguage(pkg, options.fallback);
                    }
                };
                ajaxOptions = {
etc.

I had to remove a } somewhere along the road, don't remember where anymore, but you will get an error warning if you don't. Admin, I can send you the file over mail if you want? You will understand what I did, I don't  :P
« Last Edit: October 22, 2014, 12:20:11 AM by JMH »

Constantin

  • Full Member
  • ***
  • Posts: 70
  • Karma: +1/-0
Re: Studio Lite language not working 1.1.40 dev-build
« Reply #14 on: January 15, 2015, 04:39:29 AM »
how is this going ? , I will like to change my studiolite on spanish. but the language selector has no effect.

Always it remains in english.

Help.

UPDATED: I just translated the "local-en.json" to spanish.
« Last Edit: January 15, 2015, 09:15:58 AM by Constantin »

 

Carbonate design by Bloc
variant: carbon
SMF 2.0.12 | SMF © 2016, Simple Machines