Printing header Tax Invoice in 2 languages

Ok, i have got it by below code - Tried this liquid language first time, good, makes sense.

{{ title | replace: "Tax Invoice", "Tax Invoice اسمايلاسمايل"}}

//** replace the arabic text here with any other language should print both English & the 2nd Language**//

Now, im trying the same way to change the Table column heading with the highlighted code below, but then it prints like this - Expecting a help please.

{% for column in table.columns %}

{{ column.label }} **{% if table.columns[0].label == 'Code' %}{{ table.columns[0].label | replace: "Code", "CCC" }}{% continue %}{% endif %} ** ** {% if table.columns[1].label == 'Description' %}{{ table.columns[1].label | replace: "Description", "DDD" }}{% continue %}{% endif %}** {% endfor %}

This is not a coding forum. When you develop custom themes, you are responsible for their performance yourself. If you don’t have the necessary skills, hire a local programmer. Most competent web developers should be able to do a job like this.

@Tut, i see you say this at many a times to others. can you send me a contact who can do this support. i did not find one localy. More over this forum i think have experts and the requirement is not out of subject or irrelevent. i use a server version and in saudiarabia its mandatory for the invoice header/ label in dual language. i and few others have requested couple for enabling this facility and still we waiting. i know you will say @lubos is busy, which i know is completely true. so it would be great relief if some one expert like you come in help like in this case, i think i tried good and have fixed where the syntax should rightly come, may be a small miss up or error. sure it is not a forum for learning coding, but please a small help or corrections are wonderful and make the life easy my dear friend.

buddy, please dont get me wrong :soccer::grin:

No, I am sorry, but I cannot. The forum is entirely non-commercial. it is also explicitly not meant as a debugging or instruction source for your own code. Please see FAQ - Manager Forum.

I believe a careful reading of your law will reveal this is not quite the case. The requirement is to provide Arabic translation if the invoice is in another language. An invoice in Arabic alone satisfies the requirements of the law. And the Arabic translation is currently 99% complete. If you want to join the translation team to help complete the final 1%, see Translations | Manager.

Got it! hurray! :smiley: you feel so happy if can find a solution. Really the forum helped, i just browsed some of peer communication and tried it.

the code goes as below ( Just replace the “CCC”, “DDD”,“EEE”,“AAA” to relevent language text. Thats it

{% for column in table.columns %}   
            <td style="font-weight: bold; padding: 5px 10px; text-align: {{ column.align }};border-left-width: 1px; border-bottom-width: 1px; border-top-width: 1px{% if forloop.last == true %}; border-right-width: 1px{% endif %}
            {% if column.nowrap %}; white-space: nowrap; width: 80px{% endif %}">{{ column.label }} 
            {% if column.label  == 'Code' %}{{ column.label | replace: "Code", "CCC" }}{% continue %}{% endif %} 
            {% if column.label  == 'Description' %}{{ column.label | replace: "Description", "DDD" }}{% continue %}{% endif %} 
            {% if column.label  == 'Each' %}{{ column.label | replace: "Each", "EEE" }}{% continue %}{% endif %}
            {% if column.label  == 'Unit price' %}{{ column.label | replace: "Unit price", "PPP" }}{% continue %}{% endif %}
            {% if column.label  == 'Amount' %}{{ column.label | replace: "Amount", "AAA" }}{% continue %}{% endif %}
            {% endfor %}

{% if column.label == ‘Unit price’ %}{{ column.label | replace: “Unit price”, “PPP” }}{% continue %}{% endif %}
referring the above syntax in this case, it works the same way, without {% continue %}.

in some case there might be discount on line item, so need to add
{% if column.label == ‘Discount’ %}{{ column.label | replace: “Discount”, “XXX” }}{% endif %}

@tut, You are right partially, if invoice in other language, this have to be translated to arabic. this happens exactly when items are imported to saudi. But in local sales practically nobody accepts two invoices in two languages, every client wanted a single invoice with two languages, the reason being, the people who handle these documents are not always arab speaking only, they are different nationals in different departments/funtions.

i know, i think you talking about the option in choosing the language preference. this option in administration menu/level makes the system to work in only one language throughout the company at any one point of time - so this does not serve the real purpose.
i have pointed out this in my earlier post of a relevant topic, that, there are english people as well arab people handling the system in sales, accounts, stores and management which means the language option should work in the user level at the preference/requirement of the user.
i hope @lubos have already put this in ideas. awaiting to see this facility. Thanks buddy

@ismail, there is even easier way than having those messy {% if %} statements.

Consider this:

{{ column.label | replace: "Code", "AAA" | replace: "Description", "BBB" | replace: "Amount", "CCC" }}

You can basically chain filters within single line.