Menu icon Foundation

Designer

educationbangla.com is one of the top Bangla [Bangladeshi] online newspaper. We publish educational related and realistic news. We also publish all kinds of Bangla [Bangladeshi] news. Now you can easily get all Bangladeshi news. We have a great team and they always work hard to provide you the latest and finest news. We are the only online news provider who provide unique news. As we are the latest news provider our company is the most popular online newspaper in Bangladesh. We try our best to publish the legal news as far as possible. We hope one day we will the best online newspaper provider in world

My Posts

No Content

My Comments

Education bangla commented on Oliver Camp's post about 1 year

 I have separate emails set up for different languages. Here's how I've worked around the challenges that presents without using separate partials:

Added a language variable to the yaml section of each email:


---
lang: en
---


Set up a few common translations in a file called data/translations.yml. Basically, I created an ID for the type of text I'm trying to pull:


- lang: en
btn-plan: 'Choose Your Plan'
btn-email: 'Email Us!'
- lang: es
btn-plan: 'Elija Su Plan'
btn-email: 'Correo Electrónico'


Created a translate.hbs mixin that my templates and partials can pull from. This particular mixin only translates two types buttons at the moment...but could easily be modified to add more options:


{{~#each translations~}}
{{~#ifequal this.lang ../email.lang~}}
{{~#switch ../text~}}
{{~#case "btn-plan"~}}
{{~this.btn-plan~}}
{{~/case~}}
{{~#case "btn-email"~}}
{{~this.btn-email~}}
{{~/case~}}
{{/switch}}
{{~/ifequal~}}

{{~/each~}}

The tilde (~) characters are used for collapsing the whitespace.

Note: I originally referenced this article to help me figure out that mixin.

This allowed me to insert code like this into my templates. I'm passing the ID of the element that I want to translate:

<button target="_blank" href="{{btnLink}}" class="large radius m-b-0">{{~> translate text='btn-plan' ~}}</button>

Not sure if that's the most efficient way to do everything, but it works. Handlebars and yaml are really irritating code to deal with. Education bangla

Posts Followed


Following

    No Content

Followers

My Posts

No Content

My Comments

You commented on Oliver Camp's post about 1 year

 I have separate emails set up for different languages. Here's how I've worked around the challenges that presents without using separate partials:

Added a language variable to the yaml section of each email:


---
lang: en
---


Set up a few common translations in a file called data/translations.yml. Basically, I created an ID for the type of text I'm trying to pull:


- lang: en
btn-plan: 'Choose Your Plan'
btn-email: 'Email Us!'
- lang: es
btn-plan: 'Elija Su Plan'
btn-email: 'Correo Electrónico'


Created a translate.hbs mixin that my templates and partials can pull from. This particular mixin only translates two types buttons at the moment...but could easily be modified to add more options:


{{~#each translations~}}
{{~#ifequal this.lang ../email.lang~}}
{{~#switch ../text~}}
{{~#case "btn-plan"~}}
{{~this.btn-plan~}}
{{~/case~}}
{{~#case "btn-email"~}}
{{~this.btn-email~}}
{{~/case~}}
{{/switch}}
{{~/ifequal~}}

{{~/each~}}

The tilde (~) characters are used for collapsing the whitespace.

Note: I originally referenced this article to help me figure out that mixin.

This allowed me to insert code like this into my templates. I'm passing the ID of the element that I want to translate:

<button target="_blank" href="{{btnLink}}" class="large radius m-b-0">{{~> translate text='btn-plan' ~}}</button>

Not sure if that's the most efficient way to do everything, but it works. Handlebars and yaml are really irritating code to deal with. Education bangla

Posts Followed

Following

  • No Content

Followers

  • No Content