Knowledgebase



 Categories





 Dimofinf Mobile


Subscribe now to Dimofinf Mobile and enjoy a wide range of premium services. You will receive our SMS text messages wherever you are for a very low cost! More


 Currency Converter


  • Currency
  • US$ Amount

Dealing with languages



Dimofinf offers you an easy and professional system when it comes to dealing with languages and there are some basic points which need to be clarified about Dimofinf language system:

  • Languages are saved in an XML file within the XML folder inside the Plugins folder.
  • The default language is English and its file name is saved in the following path: 'pluginfolder-language.xml' while other additional languages names are saved in the following path: 'pluginfolder-lancode.xml' where 'pluginfolder' is the name of the Plugins folder and 'languagecode' is the code of the additional language. For example,

- 'plugin-langauge.xml' this is for the main language which is English.

- 'plugin-ar-language.xml' this is for an additional language which is Arabic.


An Example for the language XML file:

CODE :
 <!--?xml version="1.0" encoding="UTF-8"?--> // phrases group <![CDATA[قائمة]]>

Notes :

  • Phrases are classified into groups and every group has its own set of phrases.
  • The 'name' function in the 'language tag' is the language title where the 'language_name' was replaced by 'language title'.
  • The 'version' function in the 'language tag' is the version number of the Dimofinf copy which the language file will work on. 
  • The 'product' function in the 'language tag' is the name of the plugins folder where 'plugin' was replaced by 'plugin folder'
  • The 'type' function in the 'language tag' is to determine the language type where the value 'master' is assigned to the default English language and the value 'custom' is assigned to all additional language like Arabic.
  • The 'name' function in the 'phrasetype' is the title of the phrases group. 
  • The 'fieldname' function in the 'phrasetype' is the name of the phrases group.  
  • The 'name' function in the 'phrase' is the phrase name.
  • The phrase is added to the tag '' where 'phrase' is replaced by the phrase desired.

    Basics :

          - Calling a phrase from the PHP file:

    In the beginning of the PHP file, you need to define the phrases groups you want to use phrases from so that you can 'call' these phrases.

     Example:

    PHP :
    {* php buffer start *} $phrasegroups[] = &#039;countries';
    $phrasegroups[] = &#039;user'; 
    {* php buffer end *}

    Note: these variables need to be defined at the beginning of the PHP file before any 'call' from the 'include' folder; this is in the case of primary files found in the primary Dimofinf folder where the variable adds the names of the phrases groups you want to call to the phrases groups matrix.

    • To call a phrase use the matrix '$dimphrase['phrase']' where 'phrase' is the phrase name. 

    Example:

    PHP :
    {* php buffer start *} $phrasegroups[] = &#039;cphome';
    $dimphrase[&#039;menu']; 
    {* php buffer end *}

     

          - Calling a phrase from a block:

    You can call a phrase from a block in two ways:

    The first:

    PHP :
    {* php buffer start *} {$dimphrase.phrasename
    {* php buffer end *}

    The second:

    PHP :
    {* php buffer start *} {phrase_phrasename
    {* php buffer end *}

    Where 'phrasename' is replaced by the phrase name.


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article


Online