Closed
Description
Currently, the website's locale is spread out throughout the site in the form of a central en.php
, or hardcoded on various pages of the site. We should combine all of these strings into the json file resources/locale/en.json
. The format of the json file should be as follows:
{
"<section>": {
"string_name": "This is a string",
"custom_string_name": "This is a string which has ${VAR} as parameter"
}
}
Then, this file must be read by php using the json_decode
function (be sure to pass true on the second argument for associative array). We can then access the strings like config::locale["section"]["string_name"]
, and we can use str_replace
to fill in any mid-string parameters.
Metadata
Metadata
Assignees
Labels
No labels