i want to implement a localization for views (should include the body, too). I've done this before by loading a JSON File and than iterate trough the keys. The keys are class names. Than i simply assign the value of the key to the element with the class.
Language File (JSON)
".Header-Title" : "My Title",
".Header-Text" : "Lorem ipsum vehicula interdum."
Code Example
$.load("./Content/Text/main-en.json", function(data) {
for (key in data) {
$(key).html(data[key]);
}
});
I liked this because the text is separated from html and script. Like to know can i accomplish this in AngularJS. My thoughts are to extend the route provider by a additional parameter that takes the path to the JSON Language File. After loading a view a function should be called that's assign the values like in the code example. Just have started with AngularJS. Any ideas or help ?