Modify Locale Strings
About Locale Files and Methods
Solar comes with a built-in localization system based on PHP
arrays, where the array key is an identifier, and the value is the
replacement string. Every class in Solar has a Locale/
subdirectory; therein are translation files named for language and
country. The default is en_US.php. The locale
file is loaded on-demand.
Every class in Solar has a locale() method that
translates a locale key to its replacement string. As with most other
things in Solar, locale files are inherited, so if you ask for a locale
key that exists only in a parent class, Solar will work up the inheritance
chain until it finds that key.
Inside a view, you can use the getText() helper
to get the locale strings for the application. (You can use the
locale() method on other objects in the view to get their translation
strings.)
Modify Locale Strings
To modify the locale strings for the blog application, change
to the Locale/ directory for the app,
and open the en_US.php file.
$ cd SYSTEM/source/acme/Acme/App/Blog/Locale
$ vim en_US.php
Change the contents of the file to the following, and save it.
'Post ID',
'TH_TITLE' => 'Post Title',
'TH_CREATED' => 'Created On',
'TH_STATUS' => 'Status',
'TH_ACTIONS' => 'Actions',
);
]]>
Now when you go to the Browse view, you should see the
translated table heading strings.