Internationalization in Frapid involves in creating language files (resources) which are saved in database. The resources are dynamically loaded initially on runtime and then saved in MemoryCache.
The resources are also provided as a dynamic JavaScript file (localization.js
) for client side use. The JavaScript resources are created every time the browser sends an HTTP get request to access that file. Along with this, Frapid provides a client side utility called localizable.js
, which automatically translates the resources for you. For more information on localizable.js utility, read the documentation here.
Frapid uses American English spelling, punctuation, and grammar rules
for neutral resource language. This does not prevent you from adding new languages.
The neutral resource language is used as fallback if the chosen user interface language does not contain the translation for any particular term. This means that you will see English along with your language during development most of the time.
Resources are broadly categorized as resource classes. We maintain a strict set of language rules to avoid confusion and improve usability. The resource classes of Frapid are :
Titles are headings that are displayed in Frapid. The headings must be very short and concise phrases. If you want to use sentences, use Labels
instead of Titles
. The titles must follow "Rules of Title Capitalization". Example:
Incorrect
- The old man and the sea
- The Old Man And The Sea
Correct
The Old Man and the Sea
NB
Everything except titles follows normal capitalization rule.
Labels are sentences that end with a period (or full stop).
Questions are displayed to users in order for them to proceed with what to do next. Since questions can be informative, descriptive, and suggestive, they can contain multiple sentences. In those cases, the closing sentence must be a question.
Errors are displayed to users when something bad happens. Whenever you are throwing errors, use this class to create resources. It is okay for an error to end with an exclamation (!) mark or a period (.).