Open Al4He6 opened 3 months ago
Dunno what has changed, copied example and corrected to use two letter language codes, but it leaves language as en/English
var langJson = { "langs": [ "English", "Español" ], "codes": { "english":"en", "español":"es" }, "trans" : { "SelectLang" : { "en":"Please select your prefered language from the 'Settings' menu", "es":"Selecciona tu idioma preferido en el menú 'Configuración'" } } }
;
function OnStart() { app.WriteFile( "lang.json", langJson ); app.SetAppLanguage( "en" );
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
spinLang = app.CreateSpinner( "en,es", 0.4 );
spinLang.SetOnChange( spinLang_OnChange );
lay.AddChild( spinLang );
app.AddLayout( lay );
app.ShowPopup(T( "SelectLang" ));
}
function spinLang_OnChange() { language = spinLang.GetText(); app.SetAppLanguage( language ); alert(app.GetLanguageCode()) alert(app.GetLanguage()) // alert(app.GetAppLanguages())
app.DestroyLayout( lay );
OnStart();
}
app.SetAppLanguage("en") gives error Unexpected end of JSON input