Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Nicolò_F_
Beginner
66 Views

Multilingual app

Jump to solution

Hello,

I want to create a Multilingual app  let the user the choice between two languages. I thought that the user could make the choice with a form ( radio button) but i don't know how to save the selection for all the future use (phone reboot ecc). Could you help me? Is there some way to make a custom "config" file in which I can save the choice made by users?

Thanks a lot

Nicolò

Tags (2)
0 Kudos
1 Solution
Hamilton_Tenório_da_
Valued Contributor I
66 Views

@Nicolò> you can use the cookie to store small data.

For example, to save data:

try {
        if(typeof(window.localStorage) !== 'undefined') {
            window.localStorage.setItem("linguaTela", wLinguaUso);
        }
        else
            {
            alert('Armazenamento local não definido (t6.1)');
            }
    }
    catch(err){
        alert('Dificuldade com o armazenamento local (t6.2): ' + err);
    }

 

and to recover data:

try {
        if(typeof(window.localStorage) !== 'undefined') {
            wLinguaUso = window.localStorage.getItem("linguaTela");
        } else {
            alert('Armazenamento local não definido (a4.1)');
            }
    }
    catch(err){
        alert('Dificuldade com o armazenamento local (a4.2): ' + err);
    }

 

For translation I use jquery.localize.min.js.

You can see this app in action in https://play.google.com/store/apps/details?id=com.hamiltonhtsnet.com.br.faleparaowhatsapp2 or https://itunes.apple.com/us/app/fale-para-o-whatsapp/id992639466?l=pt&ls=1&mt=8

View solution in original post

1 Reply
Hamilton_Tenório_da_
Valued Contributor I
67 Views

@Nicolò> you can use the cookie to store small data.

For example, to save data:

try {
        if(typeof(window.localStorage) !== 'undefined') {
            window.localStorage.setItem("linguaTela", wLinguaUso);
        }
        else
            {
            alert('Armazenamento local não definido (t6.1)');
            }
    }
    catch(err){
        alert('Dificuldade com o armazenamento local (t6.2): ' + err);
    }

 

and to recover data:

try {
        if(typeof(window.localStorage) !== 'undefined') {
            wLinguaUso = window.localStorage.getItem("linguaTela");
        } else {
            alert('Armazenamento local não definido (a4.1)');
            }
    }
    catch(err){
        alert('Dificuldade com o armazenamento local (a4.2): ' + err);
    }

 

For translation I use jquery.localize.min.js.

You can see this app in action in https://play.google.com/store/apps/details?id=com.hamiltonhtsnet.com.br.faleparaowhatsapp2 or https://itunes.apple.com/us/app/fale-para-o-whatsapp/id992639466?l=pt&ls=1&mt=8

View solution in original post

Reply