-
Notifications
You must be signed in to change notification settings - Fork 2
Usage
By now you should have the plugin installed and ready to go in your application. To start using it, just follow this simple steps:
Go though all the strings in your application that you wish to localize and wrap them the `localize`function (or `l` as as shortcut). For example: #l("Welcome to my killer app")#
Localizer will now harvest this string the next time this code runs, and it will add it to the `/plugins/Localizer/repository.cfm` file, in the format of
loc['template-where-the-string-is-located']['line-number']['string-value'] = 'string-value'
Note: When dealing with dynamic strings, such as #l("Welcome, #user.fullname# this is your dashboard")#, you will need to the special syntax of #l("Welcome, {#user.fullname#} this is your dashboard")# so that Localizer knows it should exclude that dynamic value from the repository (otherwise you will have unique strings all over the place.
After you have successfully wrapped all your strings, all you need to do is go through that `/plugins/Localizer/repository.cfm` file and extract it’s content into each language you want your application to support (Localizer will automactly create a file named as your current locale in that same directory. Paste the content of the repository in there and translate all the strings.
Repeat step #2 with all the languages you wish to support, for example: create several translations files as `/plugins/Localizer/es_ES.cfm` (Spanish, Spain), `/plugins/Localizer/en_US.cfm` (English, United States), etc.