Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display attribute with localization
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Titre:
Display attribute with localization
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01617665
Message ID:
01617665
Vues:
31
Hi everybody,

We have this problem. We have several resource files with localized strings. Some of them allow parameters, say, we have
userDefinedX	User-Defined {0}
So, we want to have a display name attribute that will read 'User-Defined 1'.

Right now the solution my colleague implemented was to create new labels for 1 and 2 and use
[Display(Name = "userDefined1", ResourceType = typeof(Labels))]
Do you think there is any solution available that would not require creating extra labels? E.g. we need to somehow be able to use the String.Format here.

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Répondre
Fil
Voir

Click here to load this message in the networking platform