• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How to translate shoppingcartsummary and whoisloggedin strings

New Here ,
Apr 22, 2014 Apr 22, 2014

Copy link to clipboard

Copied

Hello guys,

     I`ve been struggling to translate my eCommerce website to portuguese. So far Mario`s post has been of some help (http://forums.adobe.com/docs/DOC-1808). However it does not show how to translate the strings "No one is logged in" and "Shopping cart is empty", after some research I`ve found that quite a few people wants to know how to do that but all the posts related to this are over a year old that might be the reason why the solution I found in this post (http://forums.adobe.com/message/4848069) did not work. There Frank said to add the following script:

<!--This script translates "Shopping cart is empty" in something else.-->

        <script type="text/javascript">

          $.fn.replaceText = function( search, replace, text_only ) {

  return this.each(function(){

    var node = this.firstChild,

      val,

      new_val,

      remove = [];

    if ( node ) {

      do {

        if ( node.nodeType === 3 ) {

          val = node.nodeValue;

          new_val = val.replace( search, replace );

          if ( new_val !== val ) {

            if ( !text_only && /</.test( new_val ) ) {

              $(node).before( new_val );

              remove.push( node );

            } else {

              node.nodeValue = new_val;

            }

          }

        }

      } while ( node = node.nextSibling );

    }

    remove.length && $(remove).remove();

  });

};

$(".cartSummaryItem").replaceText( "Shopping cart is empty.", "Your own translation." );

</script>

right before the </body> tag. On the same post they were asking on how to translate quite a few other modules but all I need are those two, the site is supposed to be released in a week and I still couldn`t figure out how to do it manually since BC does not offer portuguese as a culture for the domain I`m using (http://www.primenutricao.com.br).

Cheers,

Alex.

TOPICS
Content management and modules , eCommerce , Newbie Corner

Views

280

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines