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

Is Your Brand Showing Up in AI Search? Most Melbourne Brands Aren't.

The New Front Door Nobody Told You About Something changed. Quietly. Without a press release. The way buyers find businesses in Australia has been rewired. Not replaced, rewired. Google isn't dead...

Daily Bulletin - avatar Daily Bulletin

How Australian Businesses Can Measure SEO ROI

SEO can feel vague when you are staring at a dashboard full of numbers that do not clearly connect to revenue. The key is to measure the right signals in the right order, then tie them back to outcome...

Daily Bulletin - avatar Daily Bulletin

How Commercial Roller Shutters Improve Site Security Without Slowing Operations

Security upgrades can be frustrating when they make everyday work harder. A door that takes too long to open, creates bottlenecks at shift change, or fails at the worst time can turn “better protectio...

Daily Bulletin - avatar Daily Bulletin

Why a Document Destruction Service Still Matters for Modern Businesses

Businesses generate large volumes of information every day, from staff records and contracts to invoices, reports and customer files. While attention often focuses on how documents are stored, the way...

Daily Bulletin - avatar Daily Bulletin

Bicycle Rack Safety and Space-Smart Storage

Bike storage problems usually show up as small annoyances first: tangled handlebars, scratched frames, and bikes that topple when you pull one out. Over time, those issues become safety risks, especia...

Daily Bulletin - avatar Daily Bulletin

How to Tell if a Childcare Centre Is a Good Fit for Your Child

Choosing childcare can feel like you’re making a huge decision with limited information. Tours are short, centres are often on their best behaviour, and your child might act differently in a new space...

Daily Bulletin - avatar Daily Bulletin

Car Import Timeline: What Usually Happens at Each Stage

Importing a car into Australia can feel confusing because multiple agencies and checkpoints are involved, and the timeline is shaped as much by paperwork quality as it is by shipping speed. The most u...

Daily Bulletin - avatar Daily Bulletin

Portable Toilet Hygiene Standards Explained: Clean vs Sanitised vs Disinfected

In portable toilet servicing, the words clean, sanitised, and disinfected often get used as if they mean the same thing. They don’t. And that difference matters because a unit can look tidy and still ...

Daily Bulletin - avatar Daily Bulletin

Options Available When a Company Faces Financial Distress

Financial distress can develop gradually or arrive suddenly, and when it does, the decisions made in the early stages often determine what options remain available later. Directors who act promptly ...

Daily Bulletin - avatar Daily Bulletin

The Daily Magazine

What Actually Makes a Good Criminal Lawyer in Melbourne

Most people only think about this question once. That is usually too late. Most people charged wi...

Why Working With A Chatswood Tutor Can Improve Academic Performance

Academic expectations continue increasing for students across primary school, high school, and senio...

Is It Worth Getting Solar Panels in Melbourne?

The real question is not whether solar works in Melbourne. It works. The question is what it is co...

How A Diploma Of Project Management Builds Practical Skills For Modern Work Environments

Developing the ability to plan, execute, and deliver outcomes efficiently is a key requirement in to...

How to Choose the Right Football for Every Level

Choosing a football may seem straightforward, but the right option depends on who will be using it a...

What to Ask a Wedding Photographer Before You Book

Booking a wedding photographer can feel deceptively simple: you like the photos, you like the vibe...

Why Stress Relief For Dogs Is Essential For Emotional Balance And Long-Term Wellbeing

Managing emotional health is just as important as physical care when it comes to pets, which is why ...

Australia’s Best Walking Trails and the Shoes You Need to Tackle Them

Australia is not short on spectacular walks. You can follow ocean cliffs in Victoria, cross ancien...

Why Pre-Purchase Building Inspections Are Essential Before Buying a Home in Australia

source Have you ever walked through an open home and started picturing your furniture, family d...