Monday, 15 June 2015

c# - WebForms Localization and Resource Files Practical Implementation -



c# - WebForms Localization and Resource Files Practical Implementation -

i looking @ localizing asp.net website written c#.net 4.5.1. know local resource files , global resource files , want clearer image on how people go doing create more practical don't find particularly nice having create 1 or more local resource files each webpage.

for example, site has on 100 .aspx webpages. each language need back upwards need create separate .resx file. supporting english, french , high german home page looks this:

default.aspx.resx default.aspx.fr.resx default.aspx.de.resx

producing of these files going hard slog. considering why can't utilize global resource file of pages? if prefix each resource appropriately page name , textual description certainly easier way manage localisation maintenance of pages.

for example, english language global resource file contain:

default-titletext - web page title default-bodytext - illustration text body of home page. login-titletext - come in login details: login-usernametext - username login-passwordtext - password login-submitbutton - login user-default-titletext - welcome personal page. user-default-username - hello {0} user-default-logout - click here logout

as can see prefix resource key page name , text description. in case of files in sub-directories prefix page name directory name (i.e. user-default-logout).

for me much more simple solution. yes, file quite big located in 1 place.

i wanted feedback other people , if practical thought or not.

and localisation different elements on forms. if create them localisable wont able store info in global resource file.

.net has inherit civilization support, why not leverage this. create new language translations in resource file appropriate naming convention , when users civilization changed pick appropriate resources. have manage manually otherwise, whats point in occurring overhead? resources compiled satellite assemblies means adding new civilization might mean application restart opposed application re-compile (if resources edited externally , without having prepare mapping).

also i'd hazard guess tooling out there rely upon these conventions. used tool called babylon.net (this not plug) , worked high german transaltor application in english. able author appropriate translations, them across , publish changes necessary. default construction must tool work, i;m sure others have dependency too. upshot beingness if go bespoke way may limiting options downwards line.

c# asp.net webforms localization resx

No comments:

Post a Comment