#
cp.strings
Provides strings from (potentially) multiple sources, with support for loading from multiple languages.
local strs = require("cp.strings").new():fromPlist("/Path/To/Resources/${language}.lproj/MYLocalization.strings")
local value = strs:find("en", "AKey")
This will load the file for the specified language (replacing ${language}
with "en"
in the path) and return the value.
Notes: This will load the file on each request. To have values cached, use the cp.strings
module and specify a plist
as a source.
#
Submodules
#
API Overview
Constructors - API calls which return an object, typically one that offers API methods
new
Methods - API calls which can only be made on an object returned by a constructor
context find findAllKeys findInSources findKeys findKeysInSources from fromPlist