Permalink
Browse files

started on package strucutre to test

  • Loading branch information...
1 parent 4c3dd08 commit ea2a07f1c6107fee5925c5204436456e4a793ef6 @shiftbot shiftbot committed Mar 3, 2012
View
2 build.proj
@@ -28,7 +28,7 @@
<Output ItemName='ProjectRootPath' TaskParameter='Include' />
</CreateItem>
<Message Text="Parsing Language.resx" Importance="High" />
- <Exec Command="build\tools\PsuedoizerConsole.exe &quot;%(ProjectRootPath.FullPath)\src\Code52.i18n.MVC4.Sample.CSharp\Resources\Language.resx&quot; &quot;%(ProjectRootPath.FullPath)\src\Code52.i18n.MVC4.Sample.CSharp\Resources\Language.pl.resx&quot;" />
+ <Exec Command="build\PsuedoizerConsole.exe &quot;%(ProjectRootPath.FullPath)\src\Code52.i18n.MVC4.Sample.CSharp\Resources\Language.resx&quot; &quot;%(ProjectRootPath.FullPath)\src\Code52.i18n.MVC4.Sample.CSharp\Resources\Language.pl.resx&quot;" />
</Target>
</Project>
View
20 build/Code52.i18n.MVC4.nuspec
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
- <metadata>
- <id>Code52.Internationalization.MVC4</id>
- <version>0.1.fizzleshnizzle</version>
- <authors>Code52</authors>
- <owners>Code52</owners>
- <licenseUrl>http://www.opensource.org/licenses/MS-PL</licenseUrl>
- <projectUrl>http://code52.org/internationalization-mvc4</projectUrl>
- <iconUrl>http://code52.org/img/logo.png</iconUrl>
- <requireLicenseAcceptance>false</requireLicenseAcceptance>
- <description>A package which configures an existing MVC application for globalization and localization</description>
- <tags>mvc mvc4 globalization localization</tags>
- </metadata>
- <dependency id="Code52.Internationalization.Core" version="0.1.fizzleshnizzle" />
- <files>
- <file src="..\src\Code52.i18n.MVC4\NuSpec\content\**\*.*" target="content" />
- <file src="..\src\Code52.i18n.MVC4\NuSpec\tools\**\*.*" target="tools" />
- </files>
-</package>
View
18 build/Code52.i18n.nuspec
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
- <metadata>
- <id>Code52.Internationalization.Core</id>
- <version>0.0.1-alpha</version>
- <authors>Code52</authors>
- <owners>Code52</owners>
- <licenseUrl>http://www.opensource.org/licenses/MS-PL</licenseUrl>
- <projectUrl>http://code52.org/internationalization-mvc4</projectUrl>
- <iconUrl>http://code52.org/img/logo.png</iconUrl>
- <requireLicenseAcceptance>false</requireLicenseAcceptance>
- <description>A package which configures an existing MVC application for globalization and localization</description>
- <tags>mvc globalization localization</tags>
- </metadata>
- <files>
- <file src="..\src\Code52.i18n\NuSpec\content\**\*.*" target="content" />
- </files>
-</package>
View
0 build/tools/PsuedoizerConsole.exe → build/PsuedoizerConsole.exe
File renamed without changes.
View
0 src/Code52.i18n.MVC/Code52.i18n.MVC.csproj → src/Code52.i18n.MVC/Code52.i18n.MVC3.csproj
File renamed without changes.
View
20 src/Code52.i18n.MVC/NuSpec/Code52.i18n.MVC3.nuspec
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <!-- Values in dollar $igns are automatically pulled from the AssemblyInfo.cs attributes by NuGet.exe -->
+ <metadata>
+ <id>Code52.i18n.MVC3</id>
+ <version>0.1</version>
+ <title>Internationalization Packages for ASP.NET MVC 3</title>
+ <authors>bforster, dchristiansen</authors>
+ <owners>bforster, dchristiansen</owners>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <iconUrl>http://code52.org/internationalization-mvc4</iconUrl>
+ <description>A core package to create an internationalization-ready web application</description>
+ <summary></summary>
+ <tags>localization globalization MVC MVC3 ASP.NET Web</tags>
+ <dependencies>
+ <dependency id="Code52.i18n" version="[0.1]" />
+ </dependencies>
+ <releaseNotes>Initial release</releaseNotes>
+ </metadata>
+</package>
View
221 src/Code52.i18n.MVC/NuSpec/Content/Controllers/AccountController.cs
@@ -0,0 +1,221 @@
+namespace $rootnamespace$.Controllers {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Web.Mvc;
+ using System.Web.Security;
+
+ using $rootnamespace$.Models;
+
+ [Authorize]
+ public class AccountController : BaseController {
+
+ //
+ // GET: /Account/Login
+
+ [AllowAnonymous]
+ public ActionResult Login() {
+ return this.ContextDependentView();
+ }
+
+ //
+ // POST: /Account/JsonLogin
+
+ [AllowAnonymous]
+ [HttpPost]
+ public JsonResult JsonLogin(LoginModel model, string returnUrl) {
+ if (this.ModelState.IsValid) {
+ if (Membership.ValidateUser(model.UserName, model.Password)) {
+ FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
+ return this.Json(new { success = true, redirect = returnUrl });
+ } else {
+ this.ModelState.AddModelError("", "The user name or password provided is incorrect.");
+ }
+ }
+
+ // If we got this far, something failed
+ return this.Json(new { errors = this.GetErrorsFromModelState() });
+ }
+
+ //
+ // POST: /Account/Login
+
+ [AllowAnonymous]
+ [HttpPost]
+ public ActionResult Login(LoginModel model, string returnUrl) {
+ if (this.ModelState.IsValid) {
+ if (Membership.ValidateUser(model.UserName, model.Password)) {
+ FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
+ if (this.Url.IsLocalUrl(returnUrl)) {
+ return this.Redirect(returnUrl);
+ } else {
+ return this.RedirectToAction("Index", "Home");
+ }
+ } else {
+ this.ModelState.AddModelError("", "The user name or password provided is incorrect.");
+ }
+ }
+
+ // If we got this far, something failed, redisplay form
+ return this.View(model);
+ }
+
+ //
+ // GET: /Account/LogOff
+
+ public ActionResult LogOff() {
+ FormsAuthentication.SignOut();
+
+ return this.RedirectToAction("Index", "Home");
+ }
+
+ //
+ // GET: /Account/Register
+
+ [AllowAnonymous]
+ public ActionResult Register() {
+ return this.ContextDependentView();
+ }
+
+ //
+ // POST: /Account/JsonRegister
+
+ [AllowAnonymous]
+ [HttpPost]
+ public ActionResult JsonRegister(RegisterModel model) {
+ if (this.ModelState.IsValid) {
+ // Attempt to register the user
+ MembershipCreateStatus createStatus;
+ Membership.CreateUser(model.UserName, model.Password, model.Email, passwordQuestion: null, passwordAnswer: null, isApproved: true, providerUserKey: null, status: out createStatus);
+
+ if (createStatus == MembershipCreateStatus.Success) {
+ FormsAuthentication.SetAuthCookie(model.UserName, createPersistentCookie: false);
+ return this.Json(new { success = true });
+ } else {
+ this.ModelState.AddModelError("", ErrorCodeToString(createStatus));
+ }
+ }
+
+ // If we got this far, something failed
+ return this.Json(new { errors = this.GetErrorsFromModelState() });
+ }
+
+ //
+ // POST: /Account/Register
+
+ [AllowAnonymous]
+ [HttpPost]
+ public ActionResult Register(RegisterModel model) {
+ if (this.ModelState.IsValid) {
+ // Attempt to register the user
+ MembershipCreateStatus createStatus;
+ Membership.CreateUser(model.UserName, model.Password, model.Email, passwordQuestion: null, passwordAnswer: null, isApproved: true, providerUserKey: null, status: out createStatus);
+
+ if (createStatus == MembershipCreateStatus.Success) {
+ FormsAuthentication.SetAuthCookie(model.UserName, createPersistentCookie: false);
+ return this.RedirectToAction("Index", "Home");
+ } else {
+ this.ModelState.AddModelError("", ErrorCodeToString(createStatus));
+ }
+ }
+
+ // If we got this far, something failed, redisplay form
+ return this.View(model);
+ }
+
+ //
+ // GET: /Account/ChangePassword
+
+ public ActionResult ChangePassword() {
+ return this.View();
+ }
+
+ //
+ // POST: /Account/ChangePassword
+
+ [HttpPost]
+ public ActionResult ChangePassword(ChangePasswordModel model) {
+ if (this.ModelState.IsValid) {
+
+ // ChangePassword will throw an exception rather
+ // than return false in certain failure scenarios.
+ bool changePasswordSucceeded;
+ try {
+ MembershipUser currentUser = Membership.GetUser(this.User.Identity.Name, userIsOnline: true);
+ changePasswordSucceeded = currentUser.ChangePassword(model.OldPassword, model.NewPassword);
+ } catch (Exception) {
+ changePasswordSucceeded = false;
+ }
+
+ if (changePasswordSucceeded) {
+ return this.RedirectToAction("ChangePasswordSuccess");
+ } else {
+ this.ModelState.AddModelError("", "The current password is incorrect or the new password is invalid.");
+ }
+ }
+
+ // If we got this far, something failed, redisplay form
+ return this.View(model);
+ }
+
+ //
+ // GET: /Account/ChangePasswordSuccess
+
+ public ActionResult ChangePasswordSuccess() {
+ return this.View();
+ }
+
+ private ActionResult ContextDependentView() {
+ string actionName = this.ControllerContext.RouteData.GetRequiredString("action");
+ if (this.Request.QueryString["content"] != null) {
+ this.ViewBag.FormAction = "Json" + actionName;
+ return this.PartialView();
+ } else {
+ this.ViewBag.FormAction = actionName;
+ return this.View();
+ }
+ }
+
+ private IEnumerable<string> GetErrorsFromModelState() {
+ return this.ModelState.SelectMany(x => x.Value.Errors.Select(error => error.ErrorMessage));
+ }
+
+ #region Status Codes
+ private static string ErrorCodeToString(MembershipCreateStatus createStatus) {
+ // See http://go.microsoft.com/fwlink/?LinkID=177550 for
+ // a full list of status codes.
+ switch (createStatus) {
+ case MembershipCreateStatus.DuplicateUserName:
+ return "User name already exists. Please enter a different user name.";
+
+ case MembershipCreateStatus.DuplicateEmail:
+ return "A user name for that e-mail address already exists. Please enter a different e-mail address.";
+
+ case MembershipCreateStatus.InvalidPassword:
+ return "The password provided is invalid. Please enter a valid password value.";
+
+ case MembershipCreateStatus.InvalidEmail:
+ return "The e-mail address provided is invalid. Please check the value and try again.";
+
+ case MembershipCreateStatus.InvalidAnswer:
+ return "The password retrieval answer provided is invalid. Please check the value and try again.";
+
+ case MembershipCreateStatus.InvalidQuestion:
+ return "The password retrieval question provided is invalid. Please check the value and try again.";
+
+ case MembershipCreateStatus.InvalidUserName:
+ return "The user name provided is invalid. Please check the value and try again.";
+
+ case MembershipCreateStatus.ProviderError:
+ return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
+
+ case MembershipCreateStatus.UserRejected:
+ return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
+
+ default:
+ return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
+ }
+ }
+ #endregion
+ }
+}
View
27 src/Code52.i18n.MVC/NuSpec/Content/Controllers/BaseController.cs
@@ -0,0 +1,27 @@
+namespace $rootnamespace$.Controllers
+{
+ using System;
+ using System.Threading;
+ using System.Web;
+ using System.Web.Mvc;
+ using System.Web.Routing;
+
+ using Code52Code;
+
+ public abstract class BaseController : Controller {
+
+ protected override IAsyncResult BeginExecute(RequestContext requestContext, AsyncCallback callback, object state)
+ {
+ var request = requestContext.HttpContext.Request;
+ string cultureName = null;
+ var cultureCookie = request.Cookies["_culture"];
+ if (request.UserLanguages != null)
+ cultureName = cultureCookie != null ? cultureCookie.Value : request.UserLanguages[0];
+ cultureName = CultureHelper.GetImplementedCulture(cultureName); // This is safe
+ Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(cultureName);
+ Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
+
+ return base.BeginExecute(requestContext, callback, state);
+ }
+ }
+}
View
28 src/Code52.i18n.MVC/NuSpec/Content/Controllers/HomeController.cs
@@ -0,0 +1,28 @@
+namespace Code52.i18n.MVCFour.Sample.CSharp.Controllers
+{
+ using System.Web.Mvc;
+
+ public class HomeController : BaseController
+ {
+ public ActionResult Index()
+ {
+ ViewBag.Message = Resources.Language.Index_Title;
+
+ return View();
+ }
+
+ public ActionResult About()
+ {
+ ViewBag.Message = Resources.Language.About_Title;
+
+ return View();
+ }
+
+ public ActionResult Contact()
+ {
+ ViewBag.Message = Resources.Language.Contact_Title;
+
+ return View();
+ }
+ }
+}
View
91 src/Code52.i18n.MVC/NuSpec/Content/Controllers/LanguageController.cs
@@ -0,0 +1,91 @@
+namespace Code52.i18n.MVCFour.Sample.CSharp.Controllers
+{
+ using System;
+ using System.Collections;
+ using System.Globalization;
+ using System.Resources;
+ using System.Text;
+ using System.Web;
+ using System.Web.Mvc;
+
+ [OutputCache(Duration = 60, VaryByCustom = "culture")]
+ public class LanguageController : BaseController
+ {
+ public RedirectResult Change(string customer, string token, string language)
+ {
+ if (string.IsNullOrWhiteSpace(language))
+ Response.Redirect("/", true);
+ if (!string.IsNullOrWhiteSpace(language))
+ {
+ switch (language.ToLower())
+ {
+ case "fr":
+ SetCulture("fr");
+ break;
+ case "pl":
+ SetCulture("pl");
+ break;
+ case "en-US":
+ SetCulture("en-US");
+ break;
+ default:
+ SetCulture("en-GB");
+ break;
+ }
+ }
+ return new RedirectResult(string.Format("/{0}/{1}/verify", customer, token));
+ }
+
+ protected void SetCulture(string name)
+ {
+ var cultureCookie = Request.Cookies["_culture"] ?? new HttpCookie("_culture");
+ cultureCookie.Value = name;
+ // NOTE: you should specify the domain for the cookie.
+ // cultureCookie.Domain = Request.Url.Host;
+ cultureCookie.Expires = DateTime.Now.AddYears(1);
+ cultureCookie.Path = "/";
+ Response.Cookies.Add(cultureCookie);
+ }
+
+ public JavaScriptResult Language()
+ {
+ return GetResourceScript(Resources.Language.ResourceManager);
+ }
+
+ JavaScriptResult GetResourceScript(ResourceManager resourceManager)
+ {
+ var cacheName = string.Format("ResourceJavaScripter.{0}", CultureInfo.CurrentCulture.Name);
+ var value = HttpRuntime.Cache.Get(cacheName) as JavaScriptResult;
+ if (value == null)
+ {
+ JavaScriptResult javaScriptResult = CreateResourceScript(resourceManager);
+ HttpContext.Cache.Insert(cacheName, javaScriptResult);
+ return javaScriptResult;
+ }
+ return value;
+ }
+
+ static JavaScriptResult CreateResourceScript(ResourceManager resourceManager)
+ {
+ var resourceSet = resourceManager.GetResourceSet(CultureInfo.CurrentCulture, true, true);
+ var sb = new StringBuilder("Code52.Language.Dictionary={");
+ foreach (DictionaryEntry dictionaryEntry in resourceSet)
+ {
+ var s = dictionaryEntry.Value as string;
+ if (s == null)
+ {
+ continue;
+ }
+ string value = resourceSet.GetString((string)dictionaryEntry.Key) ?? s;
+ sb.AppendFormat("\"{0}\":\"{1}\",", dictionaryEntry.Key, Microsoft.Security.Application.Encoder.JavaScriptEncode(value.Replace("\"", "\\\"").Replace('{', '[').Replace('}', ']'), false));
+ }
+ string script = sb.ToString();
+ if (!string.IsNullOrEmpty(script))
+ {
+ script = script.Remove(script.Length - 1);
+ }
+ script += "};";
+ return new JavaScriptResult { Script = script };
+ }
+ }
+}
View
20 src/Code52.i18n.MVC4/NuSpec/Code52.i18n.MVC4.nuspec
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <!-- Values in dollar $igns are automatically pulled from the AssemblyInfo.cs attributes by NuGet.exe -->
+ <metadata>
+ <id>Code52.i18n.MVC4</id>
+ <version>0.1</version>
+ <title>Internationalization Packages for ASP.NET MVC 4</title>
+ <authors>bforster, dchristiansen</authors>
+ <owners>bforster, dchristiansen</owners>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <iconUrl>http://code52.org/internationalization-mvc4</iconUrl>
+ <description>A core package to create an internationalization-ready web application</description>
+ <summary></summary>
+ <tags>localization globalization MVC MVC4 ASP.NET Web</tags>
+ <dependencies>
+ <dependency id="Code52.i18n" version="[0.1]" />
+ </dependencies>
+ <releaseNotes>Initial release</releaseNotes>
+ </metadata>
+</package>
View
6 src/Code52.i18n/Code52.i18n.csproj
@@ -42,6 +42,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Content Include="NuSpec\Content\Controllers\AccountController.cs" />
+ <Content Include="NuSpec\Content\Controllers\BaseController.cs" />
+ <Content Include="NuSpec\Content\Controllers\HomeController.cs" />
+ <Content Include="NuSpec\Content\Controllers\LanguageController.cs" />
+ <Content Include="NuSpec\Content\Code\CultureHelper.cs" />
+ <Content Include="NuSpec\Content\Code\LocalizationHelpers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
View
20 src/Code52.i18n/NuSpec/Code52.i18n.nuspec
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <!-- Values in dollar $igns are automatically pulled from the AssemblyInfo.cs attributes by NuGet.exe -->
+ <metadata>
+ <id>Code52.i18n</id>
+ <version>0.1</version>
+ <title>Internationalization Packages for ASP.NET</title>
+ <authors>bforster, dchristiansen</authors>
+ <owners>bforster, dchristiansen</owners>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <iconUrl>http://code52.org/internationalization-mvc4</iconUrl>
+ <description>A core package to create an internationalization-ready web application</description>
+ <summary></summary>
+ <tags>localization globalization ASP.NET Web</tags>
+ <dependencies>
+ <dependency id="jquery-globalize" version="[0.1.0]" />
+ </dependencies>
+ <releaseNotes>Initial release</releaseNotes>
+ </metadata>
+</package>
View
60 src/Code52.i18n/NuSpec/Content/Code/CultureHelper.cs
@@ -0,0 +1,60 @@
+namespace $rootnamespace$.Code52Code {
+ using System;
+ using System.Collections.Concurrent;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Threading;
+
+ public static class CultureHelper {
+ private static readonly IList<string> _validCultures = new List<string> { "af", "af-ZA", "sq", "sq-AL", "gsw-FR", "am-ET", "ar", "ar-DZ", "ar-BH", "ar-EG", "ar-IQ", "ar-JO", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-OM", "ar-QA", "ar-SA", "ar-SY", "ar-TN", "ar-AE", "ar-YE", "hy", "hy-AM", "as-IN", "az", "az-Cyrl-AZ", "az-Latn-AZ", "ba-RU", "eu", "eu-ES", "be", "be-BY", "bn-BD", "bn-IN", "bs-Cyrl-BA", "bs-Latn-BA", "br-FR", "bg", "bg-BG", "ca", "ca-ES", "zh-HK", "zh-MO", "zh-CN", "zh-Hans", "zh-SG", "zh-TW", "zh-Hant", "co-FR", "hr", "hr-HR", "hr-BA", "cs", "cs-CZ", "da", "da-DK", "prs-AF", "div", "div-MV", "nl", "nl-BE", "nl-NL", "en", "en-AU", "en-BZ", "en-CA", "en-029", "en-IN", "en-IE", "en-JM", "en-MY", "en-NZ", "en-PH", "en-SG", "en-ZA", "en-TT", "en-GB", "en-US", "en-ZW", "et", "et-EE", "fo", "fo-FO", "fil-PH", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "fr-LU", "fr-MC", "fr-CH", "fy-NL", "gl", "gl-ES", "ka", "ka-GE", "de", "de-AT", "de-DE", "de-LI", "de-LU", "de-CH", "el", "el-GR", "kl-GL", "gu", "gu-IN", "ha-Latn-NG", "he", "he-IL", "hi", "hi-IN", "hu", "hu-HU", "is", "is-IS", "ig-NG", "id", "id-ID", "iu-Latn-CA", "iu-Cans-CA", "ga-IE", "xh-ZA", "zu-ZA", "it", "it-IT", "it-CH", "ja", "ja-JP", "kn", "kn-IN", "kk", "kk-KZ", "km-KH", "qut-GT", "rw-RW", "sw", "sw-KE", "kok", "kok-IN", "ko", "ko-KR", "ky", "ky-KG", "lo-LA", "lv", "lv-LV", "lt", "lt-LT", "wee-DE", "lb-LU", "mk", "mk-MK", "ms", "ms-BN", "ms-MY", "ml-IN", "mt-MT", "mi-NZ", "arn-CL", "mr", "mr-IN", "moh-CA", "mn", "mn-MN", "mn-Mong-CN", "ne-NP", "no", "nb-NO", "nn-NO", "oc-FR", "or-IN", "ps-AF", "fa", "fa-IR", "pl", "pl-PL", "pt", "pt-BR", "pt-PT", "pa", "pa-IN", "quz-BO", "quz-EC", "quz-PE", "ro", "ro-RO", "rm-CH", "ru", "ru-RU", "smn-FI", "smj-NO", "smj-SE", "se-FI", "se-NO", "se-SE", "sms-FI", "sma-NO", "sma-SE", "sa", "sa-IN", "sr", "sr-Cyrl-BA", "sr-Cyrl-SP", "sr-Latn-BA", "sr-Latn-SP", "nso-ZA", "tn-ZA", "si-LK", "sk", "sk-SK", "sl", "sl-SI", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-CR", "es-DO", "es-EC", "es-SV", "es-GT", "es-HN", "es-MX", "es-NI", "es-PA", "es-PY", "es-PE", "es-PR", "es-ES", "es-US", "es-UY", "es-VE", "sv", "sv-FI", "sv-SE", "syr", "syr-SY", "tg-Cyrl-TJ", "tzm-Latn-DZ", "ta", "ta-IN", "tt", "tt-RU", "te", "te-IN", "th", "th-TH", "bo-CN", "tr", "tr-TR", "tk-TM", "ug-CN", "uk", "uk-UA", "wen-DE", "ur", "ur-PK", "uz", "uz-Cyrl-UZ", "uz-Latn-UZ", "vi", "vi-VN", "cy-GB", "wo-SN", "sah-RU", "ii-CN", "yo-NG" };
+ private static readonly IList<string> _cultures = new List<string> {
+ "en-GB", // first culture is the DEFAULT
+ "fr",
+ "pl"
+ };
+ private static readonly ConcurrentDictionary<string, string> _getImplementedCultureCache = new ConcurrentDictionary<string, string>();
+
+ public static string GetImplementedCulture(string name) {
+ if (string.IsNullOrEmpty(name))
+ return GetDefaultCulture(); // return Default culture
+ if (_getImplementedCultureCache.ContainsKey(name))
+ return _getImplementedCultureCache[name]; // we have worked this out before and cached the result. Send it back.
+ if (_validCultures.Count(c => c.Equals(name, StringComparison.InvariantCultureIgnoreCase)) == 0)
+ return CacheCulture(name, GetDefaultCulture()); // return Default culture if it is invalid
+ if (_cultures.Count(c => c.Equals(name, StringComparison.InvariantCultureIgnoreCase)) > 0)
+ return CacheCulture(name, name); // accept it
+ var n = GetNeutralCulture(name);
+ foreach (var c in _cultures)
+ if (c.StartsWith(n))
+ return CacheCulture(name, c);
+ return CacheCulture(name, GetDefaultCulture()); // return Default culture as no match found
+ }
+
+ private static string CacheCulture(string originalName, string implementedName)
+ {
+ _getImplementedCultureCache.AddOrUpdate(originalName, implementedName, (_, __) => implementedName);
+ return implementedName;
+ }
+
+ public static string GetDefaultCulture() {
+ return _cultures[0]; // return Default culture
+
+ }
+
+ public static string GetCurrentCulture() {
+ return Thread.CurrentThread.CurrentCulture.Name;
+ }
+
+ public static string GetCurrentNeutralCulture() {
+ return GetNeutralCulture(Thread.CurrentThread.CurrentCulture.Name);
+ }
+
+ public static string GetNeutralCulture(string name) {
+ if (name.Length < 2)
+ return name;
+
+ return name.Substring(0, 2); // Read first two chars only. E.g. "en", "es"
+ }
+
+ }
+}
View
13 src/Code52.i18n/NuSpec/Content/Code/LocalizationHelpers.cs
@@ -0,0 +1,13 @@
+namespace $rootnamespace$.Code52Code
+{
+ using System;
+ using System.Web;
+ using System.Web.Mvc;
+
+ public static class LocalizationHelpers {
+ public static IHtmlString MetaAcceptLanguage<t>(this HtmlHelper<t> html) {
+ var acceptLanguage = HttpUtility.HtmlAttributeEncode(System.Threading.Thread.CurrentThread.CurrentUICulture.ToString());
+ return new HtmlString(String.Format("<meta name=\"accept-language=\" content=\"{0}\">", acceptLanguage));
+ }
+ }
+}
View
279 src/Code52.i18n/NuSpec/Content/Resources/Language.Designer.cs
@@ -0,0 +1,279 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.261
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Code52.i18n.MVCFour.Sample.CSharp.Resources {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public class Language {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Language() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Code52.i18n.MVCFour.Sample.CSharp.Resources.Language", typeof(Language).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Your quintessential app description page..
+ /// </summary>
+ public static string About_Title {
+ get {
+ return ResourceManager.GetString("About_Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Confirm new password.
+ /// </summary>
+ public static string ChangePasswordModel_ConfirmPassword {
+ get {
+ return ResourceManager.GetString("ChangePasswordModel_ConfirmPassword", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to The new password and confirmation password do not match..
+ /// </summary>
+ public static string ChangePasswordModel_ConfirmPassword_Compare {
+ get {
+ return ResourceManager.GetString("ChangePasswordModel_ConfirmPassword_Compare", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to New password.
+ /// </summary>
+ public static string ChangePasswordModel_NewPassword {
+ get {
+ return ResourceManager.GetString("ChangePasswordModel_NewPassword", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to The {0} must be at least {2} characters long..
+ /// </summary>
+ public static string ChangePasswordModel_NewPassword_StringLength {
+ get {
+ return ResourceManager.GetString("ChangePasswordModel_NewPassword_StringLength", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Current password.
+ /// </summary>
+ public static string ChangePasswordModel_OldPassword {
+ get {
+ return ResourceManager.GetString("ChangePasswordModel_OldPassword", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Your quintessential contact page..
+ /// </summary>
+ public static string Contact_Title {
+ get {
+ return ResourceManager.GetString("Contact_Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to This text came from the resource file. how cool is that..
+ /// </summary>
+ public static string Demonstration_Alert {
+ get {
+ return ResourceManager.GetString("Demonstration_Alert", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Modify this template to jump-start your ASP.NET application.
+ /// </summary>
+ public static string Index_Title {
+ get {
+ return ResourceManager.GetString("Index_Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Password.
+ /// </summary>
+ public static string LoginModel_Password {
+ get {
+ return ResourceManager.GetString("LoginModel_Password", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Remember me?.
+ /// </summary>
+ public static string LoginModel_RememberMe {
+ get {
+ return ResourceManager.GetString("LoginModel_RememberMe", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to User name foo bar baz.
+ /// </summary>
+ public static string LoginModel_UserName {
+ get {
+ return ResourceManager.GetString("LoginModel_UserName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Code52 i18n Demo site.
+ /// </summary>
+ public static string Logo_Title {
+ get {
+ return ResourceManager.GetString("Logo_Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to My ASP.NET MVC Application.
+ /// </summary>
+ public static string Master_SiteTitle {
+ get {
+ return ResourceManager.GetString("Master_SiteTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to About.
+ /// </summary>
+ public static string Menu_About {
+ get {
+ return ResourceManager.GetString("Menu_About", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Contact.
+ /// </summary>
+ public static string Menu_Contact {
+ get {
+ return ResourceManager.GetString("Menu_Contact", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Home.
+ /// </summary>
+ public static string Menu_Home {
+ get {
+ return ResourceManager.GetString("Menu_Home", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Confirm new password.
+ /// </summary>
+ public static string RegisterModel_ConfirmPassword {
+ get {
+ return ResourceManager.GetString("RegisterModel_ConfirmPassword", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to The new password and confirmation password do not match..
+ /// </summary>
+ public static string RegisterModel_ConfirmPassword_Compare {
+ get {
+ return ResourceManager.GetString("RegisterModel_ConfirmPassword_Compare", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Password.
+ /// </summary>
+ public static string RegisterModel_Password {
+ get {
+ return ResourceManager.GetString("RegisterModel_Password", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to The {0} must be at least {2} characters long..
+ /// </summary>
+ public static string RegisterModel_Password_StringLength {
+ get {
+ return ResourceManager.GetString("RegisterModel_Password_StringLength", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to User name.
+ /// </summary>
+ public static string RegisterModel_UserName {
+ get {
+ return ResourceManager.GetString("RegisterModel_UserName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Facebook.
+ /// </summary>
+ public static string Social_Facebook {
+ get {
+ return ResourceManager.GetString("Social_Facebook", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Twitter.
+ /// </summary>
+ public static string Social_Twitter {
+ get {
+ return ResourceManager.GetString("Social_Twitter", resourceCulture);
+ }
+ }
+ }
+}
View
124 src/Code52.i18n/NuSpec/Content/Resources/Language.en-US.resx
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="Master_SiteTitle" xml:space="preserve">
+ <value>My ASP.NET MVC Application</value>
+ <comment>The title displayed on _Layout.cshtml</comment>
+ </data>
+</root>
View
124 src/Code52.i18n/NuSpec/Content/Resources/Language.fr.resx
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="Master_SiteTitle" xml:space="preserve">
+ <value>My ASP.NET MVC Application</value>
+ <comment>The title displayed on _Layout.cshtml</comment>
+ </data>
+</root>
View
198 src/Code52.i18n/NuSpec/Content/Resources/Language.resx
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="About_Title" xml:space="preserve">
+ <value>Your quintessential app description page.</value>
+ </data>
+ <data name="ChangePasswordModel_ConfirmPassword" xml:space="preserve">
+ <value>Confirm new password</value>
+ </data>
+ <data name="ChangePasswordModel_ConfirmPassword_Compare" xml:space="preserve">
+ <value>The new password and confirmation password do not match.</value>
+ </data>
+ <data name="ChangePasswordModel_NewPassword" xml:space="preserve">
+ <value>New password</value>
+ </data>
+ <data name="ChangePasswordModel_NewPassword_StringLength" xml:space="preserve">
+ <value>The {0} must be at least {2} characters long.</value>
+ </data>
+ <data name="ChangePasswordModel_OldPassword" xml:space="preserve">
+ <value>Current password</value>
+ </data>
+ <data name="Contact_Title" xml:space="preserve">
+ <value>Your quintessential contact page.</value>
+ </data>
+ <data name="Demonstration_Alert" xml:space="preserve">
+ <value>This text came from the resource file. how cool is that.</value>
+ </data>
+ <data name="Index_Title" xml:space="preserve">
+ <value>Modify this template to jump-start your ASP.NET application</value>
+ </data>
+ <data name="LoginModel_Password" xml:space="preserve">
+ <value>Password</value>
+ </data>
+ <data name="LoginModel_RememberMe" xml:space="preserve">
+ <value>Remember me?</value>
+ </data>
+ <data name="LoginModel_UserName" xml:space="preserve">
+ <value>User name foo bar baz</value>
+ </data>
+ <data name="Logo_Title" xml:space="preserve">
+ <value>Code52 i18n Demo site</value>
+ </data>
+ <data name="Master_SiteTitle" xml:space="preserve">
+ <value>My ASP.NET MVC Application</value>
+ <comment>The title displayed on _Layout.cshtml</comment>
+ </data>
+ <data name="Menu_About" xml:space="preserve">
+ <value>About</value>
+ <comment>Main menu - link text - About</comment>
+ </data>
+ <data name="Menu_Contact" xml:space="preserve">
+ <value>Contact</value>
+ <comment>Main menu - link text - Contact</comment>
+ </data>
+ <data name="Menu_Home" xml:space="preserve">
+ <value>Home</value>
+ <comment>Main menu - link text - Home</comment>
+ </data>
+ <data name="RegisterModel_ConfirmPassword" xml:space="preserve">
+ <value>Confirm new password</value>
+ </data>
+ <data name="RegisterModel_ConfirmPassword_Compare" xml:space="preserve">
+ <value>The new password and confirmation password do not match.</value>
+ </data>
+ <data name="RegisterModel_Password" xml:space="preserve">
+ <value>Password</value>
+ </data>
+ <data name="RegisterModel_Password_StringLength" xml:space="preserve">
+ <value>The {0} must be at least {2} characters long.</value>
+ </data>
+ <data name="RegisterModel_UserName" xml:space="preserve">
+ <value>User name</value>
+ </data>
+ <data name="Social_Facebook" xml:space="preserve">
+ <value>Facebook</value>
+ <comment>A link to Facebook - title reads Facebook</comment>
+ </data>
+ <data name="Social_Twitter" xml:space="preserve">
+ <value>Twitter</value>
+ <comment>A link to Twitter - title reads Twitter</comment>
+ </data>
+</root>

0 comments on commit ea2a07f

Please sign in to comment.