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 7667807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:11:54+00:00 2026-05-31T15:11:54+00:00

As far as I know, the best way to handle dynamic data in a

  • 0

As far as I know, the best way to handle dynamic data in a localized string using resource files in .NET is to have your localized string in the resources.resx file with a placeholder in it: Lorem {0} ipsum. and in your code, to handle it this way: string.Format(Resources.My_Localized_Key, myValue);.

My concerns are the following:

1/ How to be sure that the placeholder will be replaced by an actual value? For example, a new developer in your team may need to use this localized string in some new piece of code he’s writing but not being aware he has to feed it with some data. Nor what kind of data.

2/ If later, for some reasons, the localized string changes to Lorem {0} ipsum {1}., how can we ensure that all uses of this string across the application will be updated?

Is there any better way to handle this? For example a way to handle these placeholders in a strongly-typed manner without having to use reflection or having to parse the content of the localized string…? Or is it just the way to do it?

  • 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. Editorial Team
    Editorial Team
    2026-05-31T15:11:56+00:00Added an answer on May 31, 2026 at 3:11 pm

    In practice, for issue 1 developers would not be likely to reuse a string without checking its content, and if they did they would probably notice the placeholder when they run their code (or QA would). So it’s unlikely and wouldn’t be the end of the world.

    For issue 2 you could use “Find Usages” in Visual Studio for the auto-generated property that it creates for the resource to find every single place it’s used and make sure the right number (and order) of parameters is there everywhere it’s used. But generally speaking resource strings don’t get reused that much anyway (it’s actually not recommended to reuse localizable text in different contexts, as the translations may need to be changed in different contexts, due to linguistic rules or space restrictions for example).

    Another risk I would see is that a translator may omit or mess up the placeholders, which would be harder to detect. But this would be just one example of a localization bug… There are plenty of other things that can go wrong when localizing an app and there is often no sure way to guard against them.

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

Sidebar

Related Questions

I have a little problem because I don't know whats the best way to
As far as I know, there's no way to use {% include %} within
Does anyone know what the best way to implement a list/grid togglable view in
As far as know, I must be careful with PHP, and I think Javascript.
As far as I know, foreign keys (FK) are used to aid the programmer
As far as I know, Flash has to pass info off to another external
As far as I know, in gcc you can write something like: #define DBGPRINT(fmt...)
As far as i know it is not possible to do the following in
As far as I know (not much I'll admit), the currently popular programming paradigms
As far as i know, there is no direct equivalent in C#. My current

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.