Well here is a way you can do that. Lets assume you have a namespace called MyApp. And let us say you have an app with following labels, "Add", "Edit", "Delete" in your English language version. Create a file called MyApp_language_en.js and put the following code in that file.
PHP Code:
MyApp.lang = {
add: "Add",
edit: "Edit",
delete: "Delete"
};
In you code you can access these variables as
PHP Code:
....
label: MyApp.lang.add,
....
label: MyApp.lang.edit,
....
label: MyApp.lang.delete,
....
Now if you want a different language version of you application, lets say french, just copy MyApp_language_en.js to MyApp_language_fr.js and translate the values in quotes ie add, edit, delete to french. Your MyApp_language_fr.js will look like this.
PHP Code:
MyApp.lang = {
add: "Ajoutez",
edit: "Editez",
delete: "Suppression"
};
(My French is not very good this is babelfish translation for the words.)
And just load MyApp.language_fr instead of MyApp_language_en for your french version of the application.
I hope i this is the answer you were looking for.