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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:40:58+00:00 2026-05-18T04:40:58+00:00

I have a multi-language system, and all over the place I have what I

  • 0

I have a multi-language system, and all over the place I have what I would call “wrapper properties” in every class, such as:

Public Property Name(Optional ByVal ForceLanguageCode As String = Nothing) As String
    Get
        Return Translations.GetByCode(Me.EntityID, "name", ForceLanguageCode)
    End Get
    Set(ByVal value As String)
        Translations.SetByCode(Me.EntityID, "name", value, ForceLanguageCode)
    End Set
End Property

I would then copy and paste that code for every translatable field.

I am hoping to be able to replace that with one line of code somehow, with a class. The only thing that changes each time is the name of the field, such as “name”, “title”, or “subject”, etc. This seems a bit of a waste and I want my system to be as easy to use as possible for developers.

I did some research into attributes but I don’t think that is my answer as:

1) I don’t know how to automatically instantiate the objects, especially as this is extending a LINQ entity where the New() signature is already generated by the DBML. My current technique uses static functions.

2) The “EntityID” is realtime information, not compile-time.

Could anybody suggest how I could clean up this mess?

  • 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-18T04:40:58+00:00Added an answer on May 18, 2026 at 4:40 am

    Instead of strings you can use lamdas:
    Retrieving Property name from lambda expression
    That way you at least get compiletime checking.

    You could use stackwalking to infer the calling method and thus the associated property. So you don’t need to manually refer to the property at all. But I don’t like that approach.

    You can do aspect-orientated programming with an IL rewriter like PostSharp. Then you could replace the manual code with an attribute. PostSharp then adds your boilerplate code to properites with that attribute.

    But I’m not sure if your overall design for localization is good. I’ve never seen it done this way. And I don’t understand what the setter is for.

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

Sidebar

Related Questions

I have developed about 300 Applications which I would like to provide with multi-language
That sounds complicated, doesn't it... actually it's quite easy: I have a multi-language app
We're building a multi-language Drupal stack and one of the concerns we have is
I have a problem with Drupal uploads path when in a multi language site.
I'm working on a multi-language website. I have a problem with the color of
I have a multi-language .Net 4 webforms site (www.example.com/en/, www.example.com/fr/ etc.) and each language
I have a multi-language website and I'm puting the language in the URL like
I have a multi-language website. I want a module to add multiple version of
I am building a multi language site I have a descriptions table that hold
So I want to make my page to have multi language function, like German,

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.