CMS Development

MattStanleyWebb
Member

Label Translation, etc, for Custom German Quote

SOLVE

Hi, just need some general guidance.

 

I'm using the design-manager to edit various modules of our Quotes, mostly "lines_items_table".  This module has hardcoded English text such as "SUBTOTALS".

 

What is the best approach to using this in a German language quote? I've read some forum advice, but it seems to be an area in flux.  The German quote is a separate template but presumably it uses original the customised module, not a clone?

 

I also need to change our main company address on German quotes - how is this sourced and what is the best way to alter it?

 

Just don't want to create a complex solution to a solved problem.  Well, hopefully it's solved 🙂

 

 

0 Upvotes
1 Accepted solution
Jake_Lett
Solution
Guide | Partner
Guide | Partner

Label Translation, etc, for Custom German Quote

SOLVE

Are you trying to see {{ templateLang }}  when previewing the lines_item_table ? Or are you not seeing the value when previewing the quote template.html? If it is the former, the variable won't show unless you are viewing the entire document because the lines_item_table module is like a partial loaded into the full document.

View solution in original post

6 Replies 6
MattStanleyWebb
Member

Label Translation, etc, for Custom German Quote

SOLVE

I can't see any documentation on where to add a global custom variable. If I add {%set templateLang = "en" %} to the Header section of the Quote it will work within the header module, but if I add {{ templateLang }} to the lines_item_table, for example, it is blank.

 

Any advice?

0 Upvotes
Jake_Lett
Solution
Guide | Partner
Guide | Partner

Label Translation, etc, for Custom German Quote

SOLVE

Are you trying to see {{ templateLang }}  when previewing the lines_item_table ? Or are you not seeing the value when previewing the quote template.html? If it is the former, the variable won't show unless you are viewing the entire document because the lines_item_table module is like a partial loaded into the full document.

Jake_Lett
Guide | Partner
Guide | Partner

Label Translation, etc, for Custom German Quote

SOLVE

The way I have handled this is by having two quote templates that reference the same line items module.

  • Basic quote - English
  • Basic quote - German


    On the individual templates create a variable like {%set templateLang = "en" %} you can then write that on your body class like <body class="basic-quote { templateLang}}">

 

Then in your line_items module you can write conditional logic for that language variable like {% if templateLang == "en" %}Subtotals{% elif templateLang == "de" %}Zwischensummen{%endif %} 

 

You can then use that conditional logic anywhere else you need it.

MattStanleyWebb
Member

Label Translation, etc, for Custom German Quote

SOLVE

Thanks, that seems like a logical approach. Is there any documentation for adding a variable to the template ({%set templateLang = "en" %}) or is it trivial, ie you just pop it where you want?

 

Either way, appreciate your help with this.

0 Upvotes
MattStanleyWebb
Member

Label Translation, etc, for Custom German Quote

SOLVE

Thanks for your reply.  The need for translation hasn't arisen before, so I'm looking for the "best practice" approach and some guidance for its implementation.

 

Thanks.

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Label Translation, etc, for Custom German Quote

SOLVE

@A_Wessolly@karstenkoehler, @Jake_Lett   how have you all been tackling translations?

0 Upvotes