Posts Tagged ‘i18n’

Read more

Data-Driven Templating in One Line

A quick snippet for this happy morning. Actually I’m going to format it so its a couple of lines…

var html = "<li><a href='{profileUrl}'><img src='{photoUrl}'/> {name}</a></li>".replace( /\{([^\}]+)\}/g, function(matches, name) {
  return store.getValue(item, name); 
});

Read the rest of this entry »

Read more

Making a translatable login form

Today I’m going to show you how to use dojo’s built in translation system. For this example, I’m going to make a simple login form widget, that we can translate into both english and spanish (and other languages, if we choose). This form will also validate what the user puts into the form, and inject what the user inputted into the translated text itself.
Read the rest of this entry »