-- Insert some languages, including translations of themselves INSERT INTO i18n.language (code, name, fallback_id) VALUES ('en', '{}'::i18n.translated_text, NULL); INSERT INTO i18n.language (code, name, fallback_id) VALUES ('fr', i18n.translation_pair('en', 'French'), i18n.lang_id('en')); INSERT INTO i18n.language (code, name, fallback_id) VALUES ('de', i18n.translation_pair('en', 'German'), i18n.lang_id('en')); Update i18n.language Set name = i18n.translation_pair('en', 'English') Where code='en'; Update i18n.language Set name = name || i18n.list_to_translation( ARRAY[['fr', 'Anglais'],['de', 'Englisch']] ) Where code='en'; Update i18n.language Set name = i18n.combine(name, i18n.translation_pair('de', 'Deutsch')) Where code = 'de'; Update i18n.language Set name = name || i18n.translation_pair('fr', 'Allemand') Where code = 'de'; Update i18n.language Set name = name || ('fr' ==> 'Français') || ('de' ==> 'Französich') Where code = 'fr'; -- See the results Select * from i18n.language; -- More useful display of the table Select id, code, i18n.translation_to_list(name) as name, Case When fallback_id Is Null Then Null Else i18n.lang_code(fallback_id) End as fallback_code From i18n.language; -- Selecting translations ... Select i18n.set_lang('en'); Select code, i18n.translate(name) as name, i18n.translate(name, 'fr') as nom_francais From i18n.language; Set search_path to i18n,public; Select set_lang('en'); Select code, translate(name) as name, translate(name, 'fr') as nom_francais From language; Select i18n.set_lang('en'); Select code, name->! as name, name->'fr' as nom_francais From i18n.language;