This example demonstrates the various locale vipers which can be used to translate strings. Notice that the LocalizedStringResources table is used to lookup the specified string(s) and/or resource keys (=id). Within the cms manager, use Configure Localization to manage the entries within this table.
The locale.getstring() viper can be used to get the string (for the current culture) which is represented by the specified resource key/id. Use locale.culture.getstring() to get a culture specific translation for the specified resource key/id. In that case, pass a culture identifier as second parameter.
The locale.translate() viper translates the specified string into the current culture, whereas the locale.culture.translate() can be used to translate the specified string into a specific culture.
To determine the resource key/id for a specific string, use the locale.getkey() viper and specify the string using the default locale (usually en-US).
Both variants of the translate and getstring vipers (locale. and locale.culture.) also have an overload in which you can specify a list of arguments. The last three examples will clarify its purpose.