If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Language Packs / Have all products names use the css class "notranslate"

Have all products names use the css class "notranslate"

Started by structuredcable on 5 Nov 2013, 4:41 PM · Views: 6,411

Results 1 to 4 of 4
5 Nov 2013, 4:41 PM
#1
structuredcable avatar

structuredcable

New Zenner

Join Date:
Sep 2012
Posts:
10
Plugin Contributions:
0

Have all products names use the css class "notranslate"

Hello, I am implementing the Google Translate Widget onto my website. I noticed the widget translates the products names as well, which I do not want. Is there a way to give all the products names the class of "notranslate" so all the names remain unchanged? Instead off adding the names to glossary since that doesn't always work as intended. Thanks.

website link: https://www.scpcat5e.com/testsite

ZenCart V1.5 - No Upgrade
Hosted @ Geekhost
PHP Version: 5.3.27 (Zend: 2.3.0)
Database: MySQL 5.1.70-cll
Used Theme as starting point

5 Nov 2013, 7:09 PM
#2
structuredcable avatar

structuredcable

New Zenner

Join Date:
Sep 2012
Posts:
10
Plugin Contributions:
0

Re: Have all products names use the css class "notranslate"

So I figured out the answer. I would be happy to share if anybody is interested. To the moderators and more experienced zennners I have a few questions. Am I posting my questions in the right thread? Should I share my findings?
Thank you, Simon.

5 Nov 2013, 8:26 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Have all products names use the css class "notranslate"

This subforum is probably the closest to relevant; this topic doesn't exactly fit any aside from the catchall General Questions.
Sharing the solution to this issue would be very welcome, as I have never seen it asked let alone solved before. If someone else needs to know, it will be valuable to them.

6 Nov 2013, 7:20 PM
#4
structuredcable avatar

structuredcable

New Zenner

Join Date:
Sep 2012
Posts:
10
Plugin Contributions:
0

Re: Have all products names use the css class "notranslate"

Okay so these are my findings so far to fix some of the issues I was having.

  1. Website layout "breaking" - I have found putting each paragraph of text or inline elements into a <span><p>Text goes in here...</p></span> keeps the layout when you switch to another langugage. Also you can add a line break </p></span></br> after closing the tag and the layout will not "break".

  2. class ="noTranslate" - Anything thing you do not want translated, ie a website link, place into a <span class="notranslate">www.mywebsite.com</span> tag.

  3. Product names inadvertently changing - The best solution I found for this was to find the class in the correct php file and adding "notranslate" class to it. HTML elements can have multiple classes associated to them so just add a space and the name of the class. The downfall is of course this is a sitewide change so it may or may not suit your needs.

  4. Google Translator Toolkit - Using Glossaries and Corrections you can fix some inadvertently changing text, however, I am finding for some reason it does not always work correctly. For example my companies short name, SCP, works in some areas and in other areas even on the same page SCP changes to CPS. I have added this to both glossary and corrections and it does not work 100%. Not sure if there is more for me to do.

  5. Sometimes when some text is translated you lose a space in between each word. A simple word1** **word2 will fix that.

Hopefully this will help somebody. As I figure more work around I will be happy to post.

Work hard and take no prisoners my fellow Zenners,
Simon