I’m developing a CMS that required i18n support. The translation strings are stored as an array in a language file (ie, en.php). Are there any naming conventions for this..
How can I improve on the sample language file below…
// General
'general.title' => 'CMS - USA / English',
'general.save' => 'Save',
'general.choose_category' => 'Choose category',
'general.add' => 'Add',
'general.continue' => 'Continue',
'general.finish' => 'Finish',
// Navigation
'nav.categories' => 'Categories',
'nav.products' => 'Products',
'nav.collections' => 'Collections',
'nav.styles' => 'Styles',
'nav.experts' => 'Experts',
'nav.shareyourstory' => 'Share Your Story',
// Products
'cms.products' => 'Products',
'cms.add_product' => 'Add Product',
// Categories
'cms.categories' => 'Categories',
'cms.add_category' => 'Add Category',
// Collections
'cms.collections'=> 'Collections',
'cms.add_collections' => 'Add Collection',
// Stylists
'cms.styles' => 'Stylists',
'cms.add_style' => 'Add Style',
'cms.add_a_style' => 'Add a style',
// Share your story
'cms.share_your_story' => 'Share Your Story',
// Styles
'cms.add_style' => 'Add Style',
One interesting option I’ve seen is to use the English strings themselves as the keys:
Some points to note:
cms.stylesincorrectly appears asStylistsin the app. But'Styles' => 'Stylists'stands out like a sore thumb, particularly to a one-line auditing script.Categoryjust because they appear in different places.