Read The Times Australia

Daily Bulletin

Our i18n Workflow

  • Written by: Keith Pitty, Developer, The Conversation

The Conversation was launched in 2011 in partnership with Australian universities. Later on, the platform was extended to support partnerships with institutions in the UK, USA and Africa. So far, for all regions, the site was presented in English.

Then in 2015 the technical team began preparing to launch The Conversation in France. It was our first foray into using the i18n features of Rails to support the presentation of our site in another language.

To facilitate translations from English into French we chose to use the PhraseApp service.

This post describes how our i18n workflow makes use of PhraseApp.

Updating English phrases

Within our Rails apps we update the English phrases using the standard Rails i18n features. So, for example, in our main application, config/locales/tc/en.yml contains English phrases for various i18n keys that are used within the Rails application code. We need a reliable way of ensuring that the equivalent French phrases are in config/locales/tc/fr_fr.yml.

Pushing to PhraseApp

Having updated the English phrases within the Rails config/locales files, the next step in our workflow is to make them available to PhraseApp. Each of our Rails applications has a Rake task which makes use of some common utility code to do this.

    rake translations:push

When this task is run, the phraseapp-ruby RubyGem is invoked to upload the English locale file to PhraseApp via the PhraseApp API.

Each time we deploy, this rake task is run. This ensures that updates to English phrases are provided to PhraseApp in a timely fashion. It also minimises the likelihood of English phrases appearing on French pages while we wait for translations.

Translations within PhraseApp

Once the new or updated English phrases have been uploaded to PhraseApp, our colleague in Paris translates them. Due to Leighton Walter Kille’s bilingual skills and diligence together with the time difference between Australia and France, we often find the French translations available the next morning!

Pulling from PhraseApp

In a similar fashion to pushing translations, a rake task pulls translations from PhraseApp via their API.

    rake translations:pull

Running this task will update the French phrases within config/locales/tc/fr_fr.yml. Naturally, this is done on a Git branch.

Checking i18n Integrity

Without careful checking, mistakes can creep into the locale yml files. So our CI build includes a step which we call i18n-hygiene. This checks whether or not an i18n key is used in the codebase, whether interpolation variables are correctly encoded and several other tests. It’s an important part of our workflow which deserves a post in its own right so I won’t elaborate any further now.

Deploying

Once the GitHub pull request has a clean build on Buildkite and has been approved, it is merged into the master branch and deployed. Then the translations are visible on our French site.

Conclusion

The combination of Rails i18n features, PhraseApp and custom i18n checking has served us well so far. Hopefully the infrastructure we have developed will enable us to smoothly prepare for the next language that The Conversation supports.

Authors: Keith Pitty, Developer, The Conversation

Read more http://theconversation.com/our-i18n-workflow-64960

Business News

Designing Eco-Friendly Custom Water Bottles for Your Next Event

The Evolution of Sustainable Event Merchandise Event planning has undergone a massive transformation over the last decade. Gone are the days when organizers could hand out cheap, single use plastic...

Daily Bulletin - avatar Daily Bulletin

Why Choosing a Professional Florist Melbourne Makes Flower Delivery Impactful

Flowers have a great power to speak when humans cannot express their feelings with right words. Flowers are the best gifts when you are celebrating a birthday or welcoming a newborn child into your fa...

Daily Bulletin - avatar Daily Bulletin

The Business Case for Choosing Australian Fabricators Over Imported Alternatives

For a long time, you might have defaulted to overseas suppliers when sourcing fabricated metal components for a project. The unit price was lower on paper, and the maths seemed straightforward. That...

Daily Bulletin - avatar Daily Bulletin

Australian organisations are relying on business continuity plans built for a far more predictable world

Tariff escalations, supply chain fragility, geopolitical events, and the ongoing threat of cyber disruption have reshaped the risk environment facing Australian organisations. The problem is that ma...

Daily Bulletin - avatar Daily Bulletin

How to Rent a Car for Uber in Melbourne: What Every New Driver Needs to Know

Starting out as an Uber driver in Melbourne is not as complicated as it sounds but getting the vehicle right is where most new drivers get stuck. Uber has strict requirements around vehicle age, condi...

Daily Bulletin - avatar Daily Bulletin

When Should You Speak to a Lawyer About a Legal Issue?

Legal issues can begin with a simple question, then become harder to manage once formal steps are involved. Many people wait until a matter feels urgent before seeking guidance, even though earlier ...

Daily Bulletin - avatar Daily Bulletin

The strategic rise of Bali as Australia’s next essential healthcare support hub

As Australian healthcare providers grapple with unprecedented operational bottlenecks, a new nearshore model is quietly transforming patient care delivery. Forward-thinking organisations,  including...

Daily Bulletin - avatar Daily Bulletin

Cost Savings and Benefits of Using Used Pallets in Logistics

In today’s competitive logistics and supply chain industry, businesses are constantly looking for ways to reduce operational costs without compromising efficiency and reliability. One of the most prac...

Daily Bulletin - avatar Daily Bulletin

How Fulfilment Services in Australia Help Businesses Scale Efficiently

The growth of e-commerce and modern retail has transformed customer expectations. Consumers now expect fast shipping, accurate order processing, and seamless delivery experiences regardless of where...

Daily Bulletin - avatar Daily Bulletin

The Daily Magazine

Why Businesses Are Choosing Virtual Reception Services

In today’s fast-paced digital world, businesses are constantly evolving to meet the needs of their...

Why Concrete Pools Offer Endless Design Possibilities

Imagine stepping into your backyard and being greeted by a stunning pool that reflects your person...

How Legal Advice Can Help with Driving Offences

Driving is a part of everyday life for many people. It allows us the freedom to travel, commute, a...

How Experienced Lawyers Support Criminal Defence

Facing criminal charges can be one of the most daunting experiences in a person's life. The stakes...

How media and Digital Marketing agencies Help Brands Stand Out

In today’s hyper-connected world, standing out is more challenging than ever. Brands are competing...

How to Choose the Perfect Honeymoon Destination

Your wedding day is just the beginning of an incredible journey together. After saying "I do," it’...

Walking Shoes vs Running Shoes: Which Are Better for Daily Walking?

Running shoes have become the default athletic footwear for a lot of people who rarely run. That ...

What Happens to Your Rubbish After It Leaves the Kerb

Most of us don’t think much about rubbish once the bin lid closes. The truck arrives, the bins are e...

Thermoplastic vs. Paint: The True Long-Term Cost Comparison

Line marking looks like a simple line item on a school maintenance budget, until the true cost of ...