Jump to content

Translations not showing in back-office in 1.7 ?


mike10101

Recommended Posts

Hello.

 

I added a new translation string in the ps_newproducts tpl inside the theme directory and it's not showing in back-office > International > Translations.

 

I can't find the translation in any of the sections (theme, module ..).

 

{l s='Translatable text here' d='Shop.Theme.Catalog'}
 

Added this in themes/classic/modules/ps_newproducts/views/templates/hook/ps_newproducts.tpl.

 

PS version: 1.7.1.1

 

Please help.

Link to comment
Share on other sites

Hello Mike,

I've talked with the Product team to get more information. 

First, they told me that this blog article should be really useful. They also suggest you get the 1.7.2.0 version which is way better for the translations.
 

You use a domain in which its string doesn't exist, so it doesn't work. You need a personal domain in this case.

Cheers,
Antoine
Link to comment
Share on other sites

I read that article already and I really don't understand what I'm doing wrong.

 

I installed 1.7.2.0 locally and I still don't see the translation strings appear in the back-office!

I added this 

{l s='Hello World' d='Shop.Theme.Catalog'}

to themes/classic/templates/catalog/_partials/miniatures/product.tpl

 

{block name='product_miniature_item'}
  <article class="product-miniature js-product-miniature" data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}" itemscope itemtype="http://schema.org/Product">
    <div class="thumbnail-container">
      {block name='product_thumbnail'}
        <a href="{$product.url}" class="thumbnail product-thumbnail">
          <img
            src = "{$product.cover.bySize.home_default.url}"
            alt = "{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}"
            data-full-size-image-url = "{$product.cover.large.url}"
          >
        </a>
      {/block}


      <div class="product-description">
        {block name='product_name'}
            <p>{l s='Hello World' d='Shop.Theme.Catalog'}</p>
          <h1 class="h3 product-title" itemprop="name"><a href="{$product.url}">{$product.name|truncate:30:'...'}</a></h1>
        {/block}
...

 

And it still doesn't work, I tried with 

<p>{l s='Hello World' d='Shop.Custom'}</p>

and still nothing. Other than the original template and the cache files, the 'Hello World' text doesn't show up anywhere else.

 

What am I doing wrong ? Is my server missing an extension or something?

Edited by mike10101 (see edit history)
Link to comment
Share on other sites

Hello Mike, 

 

As mentioned in the introduction of the article, the translation page will look for new content outside the Classic folder:

These methods only work if you are working on a theme with a name that is not “classic”. If you’re tweaking the Classic theme and you’ve kept the “/classic” folder, your new strings won’t be detected. PrestaShop is only looking for new strings in theme folders other than “/classic”.

If you're modifying Classic, the best is to create a child theme and rename it. Then if you follow what's in the article, you should be able to translate your new strings.

 

To know more about parent/child theme, please read this documentation: 

http://developers.prestashop.com/themes/smarty/parent-child-feature.html?

 

You can also see an example here:

https://github.com/PrestaShop/childtheme-example

 

Hope this will help :)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...