1. Go to this page and download the library: Download userfrosting/i18n library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
userfrosting / i18n example snippets
return array(
//MESSAGE_KEY => Localized message
"ACCOUNT_SPECIFY_USERNAME" => "Introduce tu nombre de usuario.",
"ACCOUNT_SPECIFY_DISPLAY_NAME" => "Introduce tu nombre público.",
"ACCOUNT_USER_CHAR_LIMIT" => "Tu nombre de usuario debe estar entre {{min}} y {{max}} caracteres de longitud."
);
$dictionary = new Dictionary($locale, $this->locator);
echo $translator->translate("ACCOUNT_USER_CHAR_LIMIT", [
"min" => 4,
"max" => 200
]);
// Returns "Tu nombre de usuario debe estar entre 4 y 200 caracteres de longitud."
"COLOR" => [
"RED" => "red",
"WHITE" => "white",
[...]
];
"MY_CATS" => [
0 => "I have no cats",
1 => "I have a {{color}} cat",
2 => "I have {{plural}} {{color}} cats"
];
"COLOR" => [
"RED" => [
1 => "rouge",
2 => "rouges"
"WHITE" => [
1 => "blanc",
2 =. "blancs"
].
[...]
];
"MY_CATS" => [
0 => "I have no cats",
1 => "I have a {{color}} cat",
2 => "I have {{plural}} {{color}} cats"
];