├── .gitignore
├── README.md
├── build.cmd
├── build.proj
├── build
├── NuGet.exe
└── PsuedoizerConsole.exe
├── docs
└── logo
│ ├── ProjectIcon.png
│ ├── i18n logo.design
│ └── i18n logo_250.png
└── src
├── Code52.i18n.MVC
├── Code52.i18n.MVC.csproj
├── NuSpec
│ ├── Code52.i18n.MVC3.nuspec
│ ├── Code52.i18n.MVC4.nuspec
│ ├── Content
│ │ ├── App_Readme
│ │ │ └── Code52.i18n.MVC.readme.txt.pp
│ │ ├── App_Start
│ │ │ └── AppStart_Code52_i18n.cs.pp
│ │ ├── Code52.i18n
│ │ │ ├── CultureHelper.cs.pp
│ │ │ ├── LanguageFilterAttribute.cs.pp
│ │ │ └── LocalizationHelpers.cs.pp
│ │ ├── Content
│ │ │ └── code52.i18n
│ │ │ │ ├── Code52.i18n.css
│ │ │ │ └── images
│ │ │ │ ├── WorldHeader.png
│ │ │ │ ├── bg_regions_international_tile.png
│ │ │ │ ├── flags
│ │ │ │ ├── de.png
│ │ │ │ ├── es.png
│ │ │ │ ├── fr.png
│ │ │ │ ├── gb.png
│ │ │ │ └── it.png
│ │ │ │ └── icon_international_map.png
│ │ ├── Controllers
│ │ │ └── LanguageController.cs.pp
│ │ ├── Scripts
│ │ │ └── Code52.i18n.js
│ │ ├── Views
│ │ │ └── Shared
│ │ │ │ └── LanguageSelection.ascx
│ │ └── web.config.transform
│ └── tools
│ │ └── install.ps1
└── Properties
│ └── AssemblyInfo.cs
├── Code52.i18n.MVC3.Example
├── Code52.i18n.MVC3.Example.csproj
├── NuSpec
│ ├── Code52.i18n.MVC3.Example.Razor.nuspec
│ ├── Content
│ │ ├── App_Start
│ │ │ └── ModelMetadataProvider.cs.pp
│ │ ├── Controllers
│ │ │ ├── AccountController.cs.pp
│ │ │ ├── BooksController.cs.pp
│ │ │ └── HomeController.cs.pp
│ │ ├── Models
│ │ │ ├── Accounts
│ │ │ │ ├── ChangePasswordModel.cs.pp
│ │ │ │ ├── LoginModel.cs.pp
│ │ │ │ └── RegisterModel.cs.pp
│ │ │ └── Book.cs.pp
│ │ ├── Resources
│ │ │ ├── Books.Designer.cs.pp
│ │ │ ├── Books.resx
│ │ │ ├── Language.Designer.cs.pp
│ │ │ └── Language.resx
│ │ └── Views
│ │ │ ├── Account
│ │ │ ├── ChangePassword.cshtml.pp
│ │ │ ├── ChangePasswordSuccess.cshtml
│ │ │ ├── Login.cshtml.pp
│ │ │ └── Register.cshtml.pp
│ │ │ ├── Books
│ │ │ ├── Create.cshtml.pp
│ │ │ ├── Delete.cshtml.pp
│ │ │ ├── Details.cshtml.pp
│ │ │ ├── Edit.cshtml.pp
│ │ │ └── Index.cshtml.pp
│ │ │ ├── Home
│ │ │ ├── About.cshtml
│ │ │ └── Index.cshtml
│ │ │ └── Shared
│ │ │ └── _LoginPartial.cshtml
│ └── tools
│ │ └── install.ps1
└── Properties
│ └── AssemblyInfo.cs
├── Code52.i18n.MVC4.Example
├── Code52.i18n.MVC4.Example.csproj
├── NuSpec
│ ├── Code52.i18n.MVC4.Example.Razor.nuspec
│ ├── Content
│ │ ├── App_Start
│ │ │ └── ModelMetadataProvider.cs.pp
│ │ ├── Controllers
│ │ │ ├── AccountController.cs.pp
│ │ │ ├── BooksController.cs.pp
│ │ │ └── HomeController.cs.pp
│ │ ├── Models
│ │ │ ├── Accounts
│ │ │ │ ├── ChangePasswordModel.cs.pp
│ │ │ │ ├── LoginModel.cs.pp
│ │ │ │ └── RegisterModel.cs.pp
│ │ │ └── Book.cs.pp
│ │ ├── Resources
│ │ │ ├── Books.Designer.cs.pp
│ │ │ ├── Books.resx
│ │ │ ├── Language.Designer.cs.pp
│ │ │ └── Language.resx
│ │ └── Views
│ │ │ ├── Account
│ │ │ ├── ChangePassword.cshtml.pp
│ │ │ ├── ChangePasswordSuccess.cshtml
│ │ │ ├── Login.cshtml.pp
│ │ │ └── Register.cshtml.pp
│ │ │ ├── Books
│ │ │ ├── Create.cshtml.pp
│ │ │ ├── Delete.cshtml.pp
│ │ │ ├── Details.cshtml.pp
│ │ │ ├── Edit.cshtml.pp
│ │ │ └── Index.cshtml.pp
│ │ │ ├── Home
│ │ │ ├── About.cshtml
│ │ │ ├── Contact.cshtml
│ │ │ └── Index.cshtml
│ │ │ └── Shared
│ │ │ └── _LoginPartial.cshtml
│ └── tools
│ │ └── install.ps1
└── Properties
│ └── AssemblyInfo.cs
├── Code52.i18n.sln
└── Code52.i18n.zreproj
/.gitignore:
--------------------------------------------------------------------------------
1 | [Oo]bj/
2 | [Bb]in/
3 | *.user
4 | /TestResults
5 | *.vspscc
6 | *.vssscc
7 | deploy
8 | deploy/*
9 | *.suo
10 | *.cache
11 | packages/
12 | msbuild.log
13 | artifacts/log
14 | artifacts/
15 | post-build*
16 | _ReSharper.*
17 | deploy-to-ec2*
18 | src/Code52.i18n.MVC4.Sample.CSharp/Scripts/jquery.globalize/*
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Internationalization.MVC4
2 |
3 | ### Goals:
4 |
5 | Provide a collection of packages to help developers get started building globalized and localized application using ASP.NET MVC.
6 |
7 | ### Getting started
8 |
9 | * Read up on the [initial brainstorming](http://sync.in/ltlbzbgOQx) we did for ideas and features.
10 | * Fork the code on [GitHub](https://github.com/Code52/internationalization-mvc4) and have a play!
11 | * Introduce yourself in the [JabbR](http://jabbr.net/#/rooms/code52) room!
12 | * Grab a task from the [Trello](https://trello.com/board/internationalization-mvc4/4f49efbbd105c95e0c12332e) board and get involved!
13 |
14 | ### Possible package structure
15 |
16 | The initial plan is to ship a number of NuGet packages (and sample projects) to allow developers to pull localization features into the app.
17 |
18 | #### Note: this is subject to change
19 |
20 | * **Core** - contains the basics of creating and managing resources and consuming them in DataAnnotations and Views. Includes some tricks to ensure your app respects the culture sent from the user's browser to the server.
21 | * **Testing** - demonstrating how to test the use of resources in an app
22 | * **Browser** - extending localization to the browser and allowing the user to override the culture.
23 |
24 | Other packages under consideration:
25 |
26 | * **jQueryUI Sample Site** - how to localize UI controls which leverage jQuery and jQuery UI.
27 | * **KendoUI Sample Site** - how to localize UI controls from the Kendo UI library.
--------------------------------------------------------------------------------
/build.cmd:
--------------------------------------------------------------------------------
1 | @echo Off
2 | SETLOCAL
3 | SET NUGET=build\nuget.exe
4 |
5 | set config=%1
6 | if "%config%" == "" (
7 | set config=Debug
8 | )
9 | set version=%2
10 | if "%version%" == "" (
11 | set version=0.1.12
12 | )
13 |
14 | %WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build.proj /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
15 |
16 | rmdir artifacts /S /Q
17 | mkdir artifacts
18 |
19 | .\build\nuget.exe pack src\Code52.i18n.MVC\NuSpec\Code52.i18n.MVC3.nuspec -Version %VERSION% -OutputDirectory artifacts
20 | .\build\nuget.exe pack src\Code52.i18n.MVC\NuSpec\Code52.i18n.MVC4.nuspec -Version %VERSION% -OutputDirectory artifacts
21 | .\build\nuget.exe pack src\Code52.i18n.MVC3.Example\NuSpec\Code52.i18n.MVC3.Example.Razor.nuspec -Version %VERSION% -OutputDirectory artifacts
22 | .\build\nuget.exe pack src\Code52.i18n.MVC4.Example\NuSpec\Code52.i18n.MVC4.Example.Razor.nuspec -Version %VERSION% -OutputDirectory artifacts
--------------------------------------------------------------------------------
/build.proj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | .\
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/build/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Code52/internationalization-mvc4/50d81ecd491697484490e9913f9cc97df671f454/build/NuGet.exe
--------------------------------------------------------------------------------
/build/PsuedoizerConsole.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Code52/internationalization-mvc4/50d81ecd491697484490e9913f9cc97df671f454/build/PsuedoizerConsole.exe
--------------------------------------------------------------------------------
/docs/logo/ProjectIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Code52/internationalization-mvc4/50d81ecd491697484490e9913f9cc97df671f454/docs/logo/ProjectIcon.png
--------------------------------------------------------------------------------
/docs/logo/i18n logo.design:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Code52/internationalization-mvc4/50d81ecd491697484490e9913f9cc97df671f454/docs/logo/i18n logo.design
--------------------------------------------------------------------------------
/docs/logo/i18n logo_250.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Code52/internationalization-mvc4/50d81ecd491697484490e9913f9cc97df671f454/docs/logo/i18n logo_250.png
--------------------------------------------------------------------------------
/src/Code52.i18n.MVC/Code52.i18n.MVC.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {EFA9A1CD-06FF-41EC-9B2B-BA5EE890D2A5}
9 | Library
10 | Properties
11 | Code52.i18n.MVC
12 | Code52.i18n.MVC
13 | v4.0
14 | 512
15 | ..\
16 | true
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | Designer
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | Designer
74 |
75 |
76 |
77 |
84 |
--------------------------------------------------------------------------------
/src/Code52.i18n.MVC/NuSpec/Code52.i18n.MVC3.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0.1
5 | bforster,dchristiansen
6 | bforster,dchristiansen
7 | http://code52.org/internationalization-mvc4
8 | https://github.com/DavidChristiansen/internationalization-mvc4/raw/master/docs/logo/ProjectIcon.png
9 |
10 |
11 |
12 |
13 |
14 |
15 | Code52.i18n.MVC3
16 | ASP.NET Internationalisation (i18n) for MVC3
17 | false
18 | A core package to create an internationalization-ready web application
19 |
20 | Initial release
21 | localization globalization MVC MVC3 ASP.NET Web i18n l10n
22 |
23 |
--------------------------------------------------------------------------------
/src/Code52.i18n.MVC/NuSpec/Code52.i18n.MVC4.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0.1
5 | bforster,dchristiansen
6 | bforster,dchristiansen
7 | http://code52.org/internationalization-mvc4
8 | https://github.com/DavidChristiansen/internationalization-mvc4/raw/master/docs/logo/ProjectIcon.png
9 |
10 |
11 |
12 |
13 |
14 |
15 | Code52.i18n.MVC4
16 | ASP.NET Internationalisation (i18n) for MVC4
17 | false
18 | A core package to create an internationalization-ready web application
19 |
20 | Initial release
21 | localization globalization MVC MVC4 ASP.NET Web i18n l10n
22 |
23 |
--------------------------------------------------------------------------------
/src/Code52.i18n.MVC/NuSpec/Content/App_Readme/Code52.i18n.MVC.readme.txt.pp:
--------------------------------------------------------------------------------
1 | [Code52.i18n] - ASP.NET Internationalisation for MVC
2 |
3 | -- About Code52 i18n --
4 | The purpose of the Code52 i18n project is to provide an easy way to implement localisation support
5 | to ASP.NET project. We currently have a reference implementation for MVC3 Razor and MVC4 Razor.
6 |
7 | -- About Code52 --
8 | We want to build fun stuff in our spare time, give back to projects which need support, and create a community which is inclusive and engaging.
9 |
10 | Find out more about Code52 on their website http://code52.org/
11 |
12 | -- Getting Started --
13 |
14 | :::::::::::::::::::::::::::::::
15 | 1. Create a Language resource file
16 | :::::::::::::::::::::::::::::::
17 |
18 | Applications need to have at least one resource (resx) file to tracks the base text and translations.
19 |
20 | To add a resource file, right-click in a folder and select "Add | New Item".
21 | In the dialog box, select General from the left-hand menu and then "Resources File".
22 |
23 | Ensure that "Strings" is selected in the top-left combo box. This will give you a list of name-value pairs
24 | which you can edit and create - these will be accessible from code.
25 |
26 | If your resource file should be visible to other projects, set the "Access Modifier" value to "Public".
27 |
28 | :::::::::::::::::::::::::::::::
29 | 2. Add reference to language selection UserControl
30 | :::::::::::::::::::::::::::::::
31 |
32 | Add the following reference to a page / layout that you wish to display the language selection options to the user.
33 |
34 | @Html.Partial("LanguageSelection")
35 |
36 |
37 | :::::::::::::::::::::::::::::::
38 | 3. Update your site layout
39 | :::::::::::::::::::::::::::::::
40 |
41 |
42 | Instructions
43 | ------------
44 |
45 | Add this using statement to the top of your Razor file to reference the CultureHelper class:
46 |
47 | @using $rootnamespace$.Code52.i18n
48 |
49 |
50 | Before the closing tag reference a stylesheet to for the language selection page:
51 |
52 |
53 |
54 |
55 |
56 | Before the closing