Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 158033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:36:36+00:00 2026-05-11T10:36:36+00:00

I’m about to decide how to handle internationalisation of an XML-based format for UI

  • 0

I’m about to decide how to handle internationalisation of an XML-based format for UI description.

The format typically looks something like this:

... <devif>   <screen id='scr1' title='Settings for this and that'>     <header text='Climate readings'/>     <rd setp='123' text='Air temperature' unit='°C'/>     <rd setp='234' text='Humidity' unit='%RH'/>     <rd setp='345' text='CO2' unit='ppm'/>      <header text='Settings'/>     <wr setp='567' text='Air temperature demand' unit='°C'/>   </screen>   ... </devif> 

Each file contains lots of screens and can be up to some 10.000 lines, and we have a dozen of these files in our application.

I can still change the format to best suit our needs. So how would you go about translating this?

I’ve been thinking about some possible ways to handle this:

  • A separate file for each language containing the english text and translated text
  • Using an ID for each tag and use a separate file with translated text for each id
  • Placing all translations in the same file

The first solution has the problem where the english text might be translated into different messages depending on context.

The second solution makes the source file less readable (although not by much), and it does not handle translation of attributes easily.

The third solution would make the file very large and cumbersome to work with once the file has been translated into some 5-6 languages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:36:37+00:00Added an answer on May 11, 2026 at 10:36 am

    I would create a template file e.g. named ‘somename.xml.template’

    <devif>   <screen id='scr1' title='[SettingsForThisCard]'>     <header text='[ClimateReadings]'/>     <rd setp='123' text='[AirTemperature]' unit='°C'/> ... 

    Then you can create a bunch of ini-like files for each language containing:

    SettingsForThisCard=your message in given language

    Then, you can replace tags with the messages readed from the ini files. The advantage is that if there is a tag that has no translation, it is easy to detect and do not waste translation efforts. Also, it’s very simple, thus may not be the best one for your specific requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.