0

I'm currently working on a localization project for a GUI, and I'm facing a challenge regarding dynamic strings. Specifically, I'm unsure about the best approach for handling translations when it comes to dynamic elements such as file size restrictions.

One particular message in the GUI states, "Upload a file less than 5MB," where "5MB" is the dynamic part. However, our development team has previously mentioned that managing dynamic strings like this can be tricky when it comes to localization.

I'm seeking advice and suggestions from experienced developers or localization experts on how to effectively handle such scenarios. My main concern is whether we should remove the specific file size mentioned in the message altogether to simplify the localization process.

On one hand, removing the specific file size would make the message more generic, such as "Upload a file within the allowed size limit." This approach could potentially alleviate the complications related to localization. However, it might also reduce clarity for users who are expecting specific size restrictions.

Has anyone encountered a similar situation before? How did you handle it? I would greatly appreciate any insights, tips, or best practices regarding the localization of dynamic strings like this. Additionally, if you have any recommendations for tools or resources that could assist with managing dynamic translations effectively, please do share.

Thank you in advance for your help!

1
  • 1
    More of a Stack Overflow question of implementation, because the UX side has long been solved. (Yes, translate dynamic strings, including specific values that must change.) Commented Jul 24, 2023 at 16:12

1 Answer 1

1

Do use dynamic strings where appropriate, and more generally, make sure that you're designing for your users and not your devs.


Your devs are running into a problem, which is that concatenated strings like the following:

"the file is " + filesize + " large" 

get chopped up in the translation catalog as two or three separate things. But this is something your devs can solve. In C-like environments using GNU gettext, you can do this for example:

/* i18n-hint: %s substitutes to a filesize (like 5MB) */ printf(_("The file is %s large"), filesize); 

Here, the translators would be shown a complete string, with the info to what %s might show.

In other environments, gettext may be less appropriate, but the problem is near-universal, so solutions to it are as well. The exact details are a question for StackOverflow or something else though.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.