Tables of Contents


When you download a file of the following formats for use in a particular language, all empty translations in that language are replaced by translations in the source language. But when you download the file for translation in a language, it only contains the translations in that language. When you download the file for review in a language, it only contains the reviewed translations in that language.

PHP Arrays

  • File extension: .php

  • i18n type: PHP_ARRAY

Sample data:

<?php
$LANG = array(
"january" => "enero",
"february" => "febrero",
"march" => "marzo",
"april" => "abril",
"may" => "mayo",
"june" => "junio",
"july" => "julio",
"august" => "agosto",
"september" => "septiembre",
"october" => "octubre",
"november" => "noviembre",
"december" => "diciembre"
);>

Handling Variables in PHP Arrays

Our PHP parser is only responsible for detecting and extracting strings from a PHP Array. If variables are included then they must be handled in the manner explained by the following example:

FOOTER_COPY1" => "© .date("Y") MY CORPORATION LTD. All Rights Reserved.​

The function date needs to be replaced in the PHP file with variables as seen below:

<?php
$thisyear = date("Y");
return array(
"FOOTER_COPY1" => "© {$thisyear} MY CORPORATION LTD. All rights reserved."​


PHP Alternative Array

  • File extension: .php

  • i18n type: PHP_ALT_ARRAY

Sample data:

<?php

$LANG[&#39;_MONDAY&#39;] = "Monday";
$LANG["_TUESDAY"] = &#39;Tuesday&#39;;

/**This is a multiline
* comment***/
$LANG["_WEDNESDAY"] = &#39;&#39;;

$LANG["_Thursday"] = "Thursday";

?>


PHP DEFINE statements

  • File extension: .php

  • i18n type: PHP_DEFINE

Sample data:

<?php
DEFINE("january", "enero");
DEFINE("february", "febrero");
DEFINE("march", "marzo");
DEFINE("april", "abril");
DEFINE("may", "mayo");
DEFINE("june", "junio");
DEFINE("july", "julio");
DEFINE("august", "agosto");
DEFINE("september", "septiembre");
DEFINE("october", "octubre");
DEFINE("november", "noviembre");
DEFINE("december", "diciembre");
?>

back to top


Continue Reading

Developer Hub

File Formats

Did this answer your question?