Add new text and translation

  • I need to understand how to add new text and translation in .html page.


    a) For example, in themes/hhg_ms_r2/index.html I added the plan text:
    <a style="display:inline-block; width:100%; height:20px; background-color: #9F0; border-top:solid; border-top-width:1px; border-top-color:#FFF; z-index:2000; font-size:14px; margin-top:1px" href="http://store2.mercuni.com/index.php">Store2</a>


    How can I make the text "Store2" dynamically translated?


    I expect to replace it by something like this {#store2#}, but then how to define the value of text to be displayed and connect to language file ?



    b) In this file
    /themes/hhg_ms_r2/modules/cart.html
    we have for example the following variable/text:
    {#text_empty#} <a id="cart_continue" class="continue button" title="{#button_continue#}" href="{$BUTTON_CONTINUE}">{#button_continue#}</a>


    How the value, for example, of #text_empty#, $BUTTON_CONTINUE are defined/get/obtained ?



    Regards

  • Explaination of the usage can be found under:
    Smarty documentation - Variables loaded from config files


    Example:

    Quote

    store_files/n/themes/YOUR_THEME/index.html


    line: 1

    Code
    1. {config_load file="$language/lang_$language.conf" section="index"}


    loads

    Quote

    store_files/n/lang/LANGUAGE/lang_LANGUAGE.conf


    section

    Code
    1. [index]


    so will variable

    Code
    1. {#link_checkout#}


    correspond to

    Quote

    store_files/n/lang/LANGUAGE/lang_LANGUAGE.conf


    line: 392

    Code
    1. link_checkout = 'Cash box'
  • Great explanation! Thanks.


    a) What about url in a link? What is the better way to define it? One way is place it directly in the index.html. Other way may be add in the language file something like
    url_ink = 'www.domain.com' and in the html file <a href="{#url_ink #}"</a> but this seems dont make sense because the link is not language dependent.


    b) For example here /themes/hhg_ms_r2/admin/index.html I see the link
    <a href="{$home_link}" title="{#ADMIN_TITLE#}"><img style="display:block;" src="{$thm_path}img/logo.png" alt="{#ADMIN_TITLE#}" /></a>


    but cannot understand where the variable $home_link is defined. Can you clarify?


    Regards

  • to a) Links can be assigned like:

    Quote

    store_files/n/themes/YOUR_THEME/source/boxes.php


    line: 44

    PHP
    1. $theme->assign('cart', hhg_href_link(FILENAME_DEFAULT, 'module=cart', 'SSL'));


    and used in template with:

    Quote

    store_files/n/themes/YOUR_THEME/index.html


    Code
    1. {$cart}


    to b) see a) or

    Quote

    store_files/n/themes/YOUR_THEME/admin/source/boxes.php


    line: 39

    PHP
    1. $theme->assign('shop_link', '../' . FILENAME_DEFAULT);
  • It's defined in:

    Quote

    core/config/filenames.php


    If you would use an IDE like PhpStorm you could navigate to the declaration place with one click.