├── .editorconfig
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ └── master.yml
├── .gitignore
├── .prettierrc
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ForEvolve.AspNetCore.Localization.sln
├── LICENSE
├── README.md
├── samples
└── WebPagesSample
│ ├── Pages
│ ├── Error.cshtml
│ ├── Error.cshtml.cs
│ ├── Index.cshtml
│ ├── Index.cshtml.cs
│ ├── Privacy.cshtml
│ ├── Privacy.cshtml.cs
│ ├── Shared
│ │ ├── _CookieConsentPartial.cshtml
│ │ ├── _Layout.cshtml
│ │ └── _ValidationScriptsPartial.cshtml
│ ├── _ViewImports.cshtml
│ └── _ViewStart.cshtml
│ ├── Program.cs
│ ├── Startup.cs
│ ├── WebPagesSample.csproj
│ ├── appsettings.Development.json
│ ├── appsettings.json
│ └── wwwroot
│ ├── css
│ └── site.css
│ ├── favicon.ico
│ ├── js
│ └── site.js
│ └── lib
│ ├── bootstrap
│ ├── LICENSE
│ └── dist
│ │ ├── css
│ │ ├── bootstrap-grid.css
│ │ ├── bootstrap-grid.css.map
│ │ ├── bootstrap-grid.min.css
│ │ ├── bootstrap-grid.min.css.map
│ │ ├── bootstrap-reboot.css
│ │ ├── bootstrap-reboot.css.map
│ │ ├── bootstrap-reboot.min.css
│ │ ├── bootstrap-reboot.min.css.map
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ ├── bootstrap.min.css
│ │ └── bootstrap.min.css.map
│ │ └── js
│ │ ├── bootstrap.bundle.js
│ │ ├── bootstrap.bundle.js.map
│ │ ├── bootstrap.bundle.min.js
│ │ ├── bootstrap.bundle.min.js.map
│ │ ├── bootstrap.js
│ │ ├── bootstrap.js.map
│ │ ├── bootstrap.min.js
│ │ └── bootstrap.min.js.map
│ ├── jquery-validation-unobtrusive
│ ├── LICENSE.txt
│ ├── jquery.validate.unobtrusive.js
│ └── jquery.validate.unobtrusive.min.js
│ ├── jquery-validation
│ ├── LICENSE.md
│ └── dist
│ │ ├── additional-methods.js
│ │ ├── additional-methods.min.js
│ │ ├── jquery.validate.js
│ │ └── jquery.validate.min.js
│ └── jquery
│ ├── LICENSE.txt
│ └── dist
│ ├── jquery.js
│ ├── jquery.min.js
│ └── jquery.min.map
├── src
└── ForEvolve.AspNetCore.Localization
│ ├── Adapters
│ ├── BaseLocalizationValidationAttributeAdapter.cs
│ ├── DefaultLocalizationValidationAttributeAdapter.cs
│ └── StringLengthLocalizationValidationAttributeAdapter.cs
│ ├── ForEvolve.AspNetCore.Localization.csproj
│ ├── ForEvolveLocalizationValidationMetadataProvider.cs
│ ├── ILocalizationValidationAttributeAdapter.cs
│ ├── ILocalizationValidationMetadataProvider.cs
│ ├── ISupportedCulturesCollection.cs
│ ├── LocalizationOptionsInitializer.cs
│ ├── MvcOptionsInitializer.cs
│ ├── RequestLocalizationOptionsInitializer.cs
│ ├── Resources
│ ├── DataAnnotationSharedResource.Designer.cs
│ ├── DataAnnotationSharedResource.es.resx
│ ├── DataAnnotationSharedResource.fr.resx
│ ├── DataAnnotationSharedResource.he.resx
│ ├── DataAnnotationSharedResource.nb.resx
│ ├── DataAnnotationSharedResource.no.resx
│ ├── DataAnnotationSharedResource.pl.resx
│ ├── DataAnnotationSharedResource.pt-BR.resx
│ ├── DataAnnotationSharedResource.pt.resx
│ ├── DataAnnotationSharedResource.resx
│ ├── DataAnnotationSharedResource.zh-Hant.resx
│ ├── DataAnnotationSharedResource.zh-TW.resx
│ └── DataAnnotationSharedResource.zh.resx
│ ├── StartupExtensions.cs
│ └── SupportedCulturesCollection.cs
├── test
├── ForEvolve.AspNetCore.Localization.FunctionalTests
│ ├── ForEvolve.AspNetCore.Localization.FunctionalTests.csproj
│ └── RazorPagesLocalizationTest.cs
└── ForEvolve.AspNetCore.Localization.Tests
│ ├── Adapters
│ ├── BaseLocalizationValidationAttributeAdapterTest.cs
│ ├── DefaultLocalizationValidationAttributeAdapterTest.cs
│ └── StringLengthLocalizationValidationAttributeAdapterTest.cs
│ ├── ForEvolve.AspNetCore.Localization.Tests.csproj
│ ├── ForEvolveLocalizationStartupExtensionsTest.cs
│ ├── ForEvolveLocalizationValidationMetadataProviderTest.cs
│ └── Resources
│ ├── DataAnnotationTestResource.Designer.cs
│ └── DataAnnotationTestResource.resx
└── version.json
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: Carl-Hugo # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: carlhugo # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | **Describe the bug**
8 | A clear and concise description of what the bug is.
9 |
10 | **To Reproduce**
11 | Steps to reproduce the behavior:
12 |
13 | 1. Go to '...'
14 | 2. Click on '....'
15 | 3. Scroll down to '....'
16 | 4. See error
17 |
18 | **Expected behavior**
19 | A clear and concise description of what you expected to happen.
20 |
21 | **Screenshots**
22 | If applicable, add screenshots to help explain your problem.
23 |
24 | **Desktop (please complete the following information):**
25 |
26 | - OS: [e.g. iOS]
27 | - Browser [e.g. chrome, safari]
28 | - Version [e.g. 22]
29 |
30 | **Smartphone (please complete the following information):**
31 |
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 |
5 | ---
6 |
7 | **Is your feature request related to a problem? Please describe.**
8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9 |
10 | **Describe the solution you'd like**
11 | A clear and concise description of what you want to happen.
12 |
13 | **Describe alternatives you've considered**
14 | A clear and concise description of any alternative solutions or features you've considered.
15 |
16 | **Additional context**
17 | Add any other context or screenshots about the feature request here.
18 |
--------------------------------------------------------------------------------
/.github/workflows/master.yml:
--------------------------------------------------------------------------------
1 | name: Build, Test, and Deploy
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | paths-ignore:
8 | - 'samples/**'
9 |
10 | pull_request:
11 | branches:
12 | - master
13 | env:
14 | DOTNET_2_VERSION: 2.1.808
15 | DOTNET_3_VERSION: 3.1.302
16 | DOTNET_5_VERSION: 5.0.100-preview.6.20318.15
17 | BUILD_CONFIGURATION: Release
18 |
19 | jobs:
20 | build-test-and-deploy:
21 | runs-on: ubuntu-latest
22 |
23 | steps:
24 | - uses: actions/checkout@v1
25 |
26 | - name: Setup .NET Core
27 | uses: coderpatros/setup-dotnet@sxs
28 | with:
29 | dotnet-version: ${{ env.DOTNET_2_VERSION }},${{ env.DOTNET_3_VERSION }},${{ env.DOTNET_5_VERSION }}
30 |
31 | - name: Build
32 | run: dotnet build --configuration ${{ env.BUILD_CONFIGURATION }}
33 |
34 | - name: Unit Test
35 | run: dotnet test --configuration ${{ env.BUILD_CONFIGURATION }}
36 |
37 | - uses: aarnott/nbgv@v0.3
38 | with:
39 | setAllVars: true
40 |
41 | - name: Pack
42 | run: dotnet pack --configuration ${{ env.BUILD_CONFIGURATION }}
43 |
44 | - name: Push to feedz.io
45 | run: dotnet nuget push **/*.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s https://f.feedz.io/forevolve/localization/nuget/index.json
46 | if: github.event_name == 'pull_request'
47 |
48 | - name: Push to NuGet.org
49 | run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
50 | if: github.event_name == 'push'
51 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # .NET Core
46 | project.lock.json
47 | project.fragment.lock.json
48 | artifacts/
49 | **/Properties/launchSettings.json
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # Visual Studio code coverage results
117 | *.coverage
118 | *.coveragexml
119 |
120 | # NCrunch
121 | _NCrunch_*
122 | .*crunch*.local.xml
123 | nCrunchTemp_*
124 |
125 | # MightyMoose
126 | *.mm.*
127 | AutoTest.Net/
128 |
129 | # Web workbench (sass)
130 | .sass-cache/
131 |
132 | # Installshield output folder
133 | [Ee]xpress/
134 |
135 | # DocProject is a documentation generator add-in
136 | DocProject/buildhelp/
137 | DocProject/Help/*.HxT
138 | DocProject/Help/*.HxC
139 | DocProject/Help/*.hhc
140 | DocProject/Help/*.hhk
141 | DocProject/Help/*.hhp
142 | DocProject/Help/Html2
143 | DocProject/Help/html
144 |
145 | # Click-Once directory
146 | publish/
147 |
148 | # Publish Web Output
149 | *.[Pp]ublish.xml
150 | *.azurePubxml
151 | # TODO: Comment the next line if you want to checkin your web deploy settings
152 | # but database connection strings (with potential passwords) will be unencrypted
153 | *.pubxml
154 | *.publishproj
155 |
156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
157 | # checkin your Azure Web App publish settings, but sensitive information contained
158 | # in these scripts will be unencrypted
159 | PublishScripts/
160 |
161 | # NuGet Packages
162 | *.nupkg
163 | # The packages folder can be ignored because of Package Restore
164 | **/packages/*
165 | # except build/, which is used as an MSBuild target.
166 | !**/packages/build/
167 | # Uncomment if necessary however generally it will be regenerated when needed
168 | #!**/packages/repositories.config
169 | # NuGet v3's project.json files produces more ignorable files
170 | *.nuget.props
171 | *.nuget.targets
172 |
173 | # Microsoft Azure Build Output
174 | csx/
175 | *.build.csdef
176 |
177 | # Microsoft Azure Emulator
178 | ecf/
179 | rcf/
180 |
181 | # Windows Store app package directories and files
182 | AppPackages/
183 | BundleArtifacts/
184 | Package.StoreAssociation.xml
185 | _pkginfo.txt
186 |
187 | # Visual Studio cache files
188 | # files ending in .cache can be ignored
189 | *.[Cc]ache
190 | # but keep track of directories ending in .cache
191 | !*.[Cc]ache/
192 |
193 | # Others
194 | ClientBin/
195 | ~$*
196 | *~
197 | *.dbmdl
198 | *.dbproj.schemaview
199 | *.jfm
200 | *.pfx
201 | *.publishsettings
202 | orleans.codegen.cs
203 |
204 | # Since there are multiple workflows, uncomment next line to ignore bower_components
205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206 | #bower_components/
207 |
208 | # RIA/Silverlight projects
209 | Generated_Code/
210 |
211 | # Backup & report files from converting an old project file
212 | # to a newer Visual Studio version. Backup files are not needed,
213 | # because we have git ;-)
214 | _UpgradeReport_Files/
215 | Backup*/
216 | UpgradeLog*.XML
217 | UpgradeLog*.htm
218 |
219 | # SQL Server files
220 | *.mdf
221 | *.ldf
222 | *.ndf
223 |
224 | # Business Intelligence projects
225 | *.rdl.data
226 | *.bim.layout
227 | *.bim_*.settings
228 |
229 | # Microsoft Fakes
230 | FakesAssemblies/
231 |
232 | # GhostDoc plugin setting file
233 | *.GhostDoc.xml
234 |
235 | # Node.js Tools for Visual Studio
236 | .ntvs_analysis.dat
237 | node_modules/
238 |
239 | # Typescript v1 declaration files
240 | typings/
241 |
242 | # Visual Studio 6 build log
243 | *.plg
244 |
245 | # Visual Studio 6 workspace options file
246 | *.opt
247 |
248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
249 | *.vbw
250 |
251 | # Visual Studio LightSwitch build output
252 | **/*.HTMLClient/GeneratedArtifacts
253 | **/*.DesktopClient/GeneratedArtifacts
254 | **/*.DesktopClient/ModelManifest.xml
255 | **/*.Server/GeneratedArtifacts
256 | **/*.Server/ModelManifest.xml
257 | _Pvt_Extensions
258 |
259 | # Paket dependency manager
260 | .paket/paket.exe
261 | paket-files/
262 |
263 | # FAKE - F# Make
264 | .fake/
265 |
266 | # JetBrains Rider
267 | .idea/
268 | *.sln.iml
269 |
270 | # CodeRush
271 | .cr/
272 |
273 | # Python Tools for Visual Studio (PTVS)
274 | __pycache__/
275 | *.pyc
276 |
277 | # Cake - Uncomment if you are using it
278 | # tools/**
279 | # !tools/packages.config
280 |
281 | # Telerik's JustMock configuration file
282 | *.jmconfig
283 |
284 | # BizTalk build output
285 | *.btp.cs
286 | *.btm.cs
287 | *.odx.cs
288 | *.xsd.cs
289 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/prettierrc",
3 | "tabWidth": 4,
4 | "printWidth": 140,
5 | "singleQuote": true,
6 | "overrides": [
7 | {
8 | "files": ["*.yaml"],
9 | "options": {
10 | "tabWidth": 2
11 | }
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | - Using welcoming and inclusive language
12 | - Being respectful of differing viewpoints and experiences
13 | - Gracefully accepting constructive criticism
14 | - Focusing on what is best for the community
15 | - Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | - Trolling, insulting/derogatory comments, and personal or political attacks
21 | - Public or private harassment
22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | - Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at opensource@forevolve.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing to ForEvolve open source projects
2 |
3 | First off, thanks for taking the time to contribute and for your interest in the project!
4 |
5 | Please visit [ForEvolve Table of content](https://github.com/ForEvolve/Toc/blob/master/CONTRIBUTING.md) for more information.
6 |
--------------------------------------------------------------------------------
/ForEvolve.AspNetCore.Localization.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26730.16
5 | MinimumVisualStudioVersion = 15.0.26124.0
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EED38C94-A14E-432F-A346-DA1E82C23DA9}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ForEvolve.AspNetCore.Localization", "src\ForEvolve.AspNetCore.Localization\ForEvolve.AspNetCore.Localization.csproj", "{D8CF62D2-3FA7-4B51-88F4-078009A1552A}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9E197274-56E0-494A-82DA-F13B73EC6A9E}"
11 | EndProject
12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ForEvolve.AspNetCore.Localization.Tests", "test\ForEvolve.AspNetCore.Localization.Tests\ForEvolve.AspNetCore.Localization.Tests.csproj", "{59367394-8BA9-487E-820F-22F50C5B135B}"
13 | EndProject
14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ForEvolve.AspNetCore.Localization.FunctionalTests", "test\ForEvolve.AspNetCore.Localization.FunctionalTests\ForEvolve.AspNetCore.Localization.FunctionalTests.csproj", "{706284E5-D874-43A5-917C-6FADEDDE5A67}"
15 | EndProject
16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{22417FE1-4E21-4DC7-8B68-A2491974909C}"
17 | EndProject
18 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebPagesSample", "samples\WebPagesSample\WebPagesSample.csproj", "{8E1C648D-A7E2-49C0-8E90-09913A7BB999}"
19 | EndProject
20 | Global
21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 | Debug|Any CPU = Debug|Any CPU
23 | Debug|x64 = Debug|x64
24 | Debug|x86 = Debug|x86
25 | Release|Any CPU = Release|Any CPU
26 | Release|x64 = Release|x64
27 | Release|x86 = Release|x86
28 | EndGlobalSection
29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
30 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Debug|Any CPU.Build.0 = Debug|Any CPU
32 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Debug|x64.ActiveCfg = Debug|Any CPU
33 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Debug|x64.Build.0 = Debug|Any CPU
34 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Debug|x86.ActiveCfg = Debug|Any CPU
35 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Debug|x86.Build.0 = Debug|Any CPU
36 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Release|Any CPU.ActiveCfg = Release|Any CPU
37 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Release|Any CPU.Build.0 = Release|Any CPU
38 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Release|x64.ActiveCfg = Release|Any CPU
39 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Release|x64.Build.0 = Release|Any CPU
40 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Release|x86.ActiveCfg = Release|Any CPU
41 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A}.Release|x86.Build.0 = Release|Any CPU
42 | {59367394-8BA9-487E-820F-22F50C5B135B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43 | {59367394-8BA9-487E-820F-22F50C5B135B}.Debug|Any CPU.Build.0 = Debug|Any CPU
44 | {59367394-8BA9-487E-820F-22F50C5B135B}.Debug|x64.ActiveCfg = Debug|Any CPU
45 | {59367394-8BA9-487E-820F-22F50C5B135B}.Debug|x64.Build.0 = Debug|Any CPU
46 | {59367394-8BA9-487E-820F-22F50C5B135B}.Debug|x86.ActiveCfg = Debug|Any CPU
47 | {59367394-8BA9-487E-820F-22F50C5B135B}.Debug|x86.Build.0 = Debug|Any CPU
48 | {59367394-8BA9-487E-820F-22F50C5B135B}.Release|Any CPU.ActiveCfg = Release|Any CPU
49 | {59367394-8BA9-487E-820F-22F50C5B135B}.Release|Any CPU.Build.0 = Release|Any CPU
50 | {59367394-8BA9-487E-820F-22F50C5B135B}.Release|x64.ActiveCfg = Release|Any CPU
51 | {59367394-8BA9-487E-820F-22F50C5B135B}.Release|x64.Build.0 = Release|Any CPU
52 | {59367394-8BA9-487E-820F-22F50C5B135B}.Release|x86.ActiveCfg = Release|Any CPU
53 | {59367394-8BA9-487E-820F-22F50C5B135B}.Release|x86.Build.0 = Release|Any CPU
54 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Debug|Any CPU.Build.0 = Debug|Any CPU
56 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Debug|x64.ActiveCfg = Debug|Any CPU
57 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Debug|x64.Build.0 = Debug|Any CPU
58 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Debug|x86.ActiveCfg = Debug|Any CPU
59 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Debug|x86.Build.0 = Debug|Any CPU
60 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Release|Any CPU.ActiveCfg = Release|Any CPU
61 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Release|Any CPU.Build.0 = Release|Any CPU
62 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Release|x64.ActiveCfg = Release|Any CPU
63 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Release|x64.Build.0 = Release|Any CPU
64 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Release|x86.ActiveCfg = Release|Any CPU
65 | {706284E5-D874-43A5-917C-6FADEDDE5A67}.Release|x86.Build.0 = Release|Any CPU
66 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Debug|Any CPU.Build.0 = Debug|Any CPU
68 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Debug|x64.ActiveCfg = Debug|Any CPU
69 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Debug|x64.Build.0 = Debug|Any CPU
70 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Debug|x86.ActiveCfg = Debug|Any CPU
71 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Debug|x86.Build.0 = Debug|Any CPU
72 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Release|Any CPU.ActiveCfg = Release|Any CPU
73 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Release|Any CPU.Build.0 = Release|Any CPU
74 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Release|x64.ActiveCfg = Release|Any CPU
75 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Release|x64.Build.0 = Release|Any CPU
76 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Release|x86.ActiveCfg = Release|Any CPU
77 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999}.Release|x86.Build.0 = Release|Any CPU
78 | EndGlobalSection
79 | GlobalSection(SolutionProperties) = preSolution
80 | HideSolutionNode = FALSE
81 | EndGlobalSection
82 | GlobalSection(NestedProjects) = preSolution
83 | {D8CF62D2-3FA7-4B51-88F4-078009A1552A} = {EED38C94-A14E-432F-A346-DA1E82C23DA9}
84 | {59367394-8BA9-487E-820F-22F50C5B135B} = {9E197274-56E0-494A-82DA-F13B73EC6A9E}
85 | {706284E5-D874-43A5-917C-6FADEDDE5A67} = {9E197274-56E0-494A-82DA-F13B73EC6A9E}
86 | {8E1C648D-A7E2-49C0-8E90-09913A7BB999} = {22417FE1-4E21-4DC7-8B68-A2491974909C}
87 | EndGlobalSection
88 | GlobalSection(ExtensibilityGlobals) = postSolution
89 | SolutionGuid = {7F6DA97F-BCD5-4C3B-B42B-80BE8E7DD008}
90 | EndGlobalSection
91 | EndGlobal
92 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Carl-Hugo Marcotte
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 |
Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Error.cshtml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Mvc;
7 | using Microsoft.AspNetCore.Mvc.RazorPages;
8 |
9 | namespace WebPagesSample.Pages
10 | {
11 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
12 | public class ErrorModel : PageModel
13 | {
14 | public string RequestId { get; set; }
15 |
16 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
17 |
18 | public void OnGet()
19 | {
20 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Index.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model IndexModel
3 | @{
4 | ViewData["Title"] = "Home page";
5 | }
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Index.cshtml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Mvc;
7 | using Microsoft.AspNetCore.Mvc.RazorPages;
8 |
9 | namespace WebPagesSample.Pages
10 | {
11 | public class IndexModel : PageModel
12 | {
13 | [BindProperty]
14 | public ValidationModel Model { get; set; } = new ValidationModel();
15 |
16 | public IActionResult OnGet()
17 | {
18 | return Page();
19 | }
20 |
21 | public IActionResult OnPost()
22 | {
23 | var form = Request.Form;
24 | if (!ModelState.IsValid)
25 | {
26 | return Page();
27 | }
28 | return Redirect("/?success=true");
29 | }
30 |
31 | public class ValidationModel
32 | {
33 | [Compare(nameof(Compare2))]
34 | public string Compare1 { get; set; } = "Some value";
35 | public string Compare2 { get; set; } = "Some non-matching value";
36 | [CreditCard]
37 | public string CreditCard { get; set; } = "Not a credit card";
38 | [EmailAddress]
39 | public string EmailAddress { get; set; } = "not an email address";
40 | [FileExtensions]
41 | public string FileExtensions { get; set; } = "toto.unknown";
42 | [MaxLength(5)]
43 | public string MaxLength { get; set; } = "ABCDEF";
44 | [MinLength(5)]
45 | public string MinLength { get; set; } = "ABC";
46 | [Phone]
47 | public string Phone { get; set; } = "not a phone";
48 | [Range(10, 20)]
49 | public int Range { get; set; } = 30;
50 | [RegularExpression("[a-z]")]
51 | public string RegularExpression { get; set; } = "1";
52 | [Required]
53 | public string Required { get; set; }
54 | [StringLength(5)]
55 | public string StringLength { get; set; } = "ABCDEF";
56 | [StringLength(5, MinimumLength = 3)]
57 | public string StringLengthIncludingMinimum { get; set; } = "AB";
58 | [Url]
59 | public string Website { get; set; } = "Not an URL";
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Privacy.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model PrivacyModel
3 | @{
4 | ViewData["Title"] = "Privacy Policy";
5 | }
6 | @ViewData["Title"]
7 |
8 | Use this page to detail your site's privacy policy.
9 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Privacy.cshtml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Mvc;
6 | using Microsoft.AspNetCore.Mvc.RazorPages;
7 |
8 | namespace WebPagesSample.Pages
9 | {
10 | public class PrivacyModel : PageModel
11 | {
12 | public void OnGet()
13 | {
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Shared/_CookieConsentPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Http.Features
2 |
3 | @{
4 | var consentFeature = Context.Features.Get();
5 | var showBanner = !consentFeature?.CanTrack ?? false;
6 | var cookieString = consentFeature?.CreateConsentCookie();
7 | }
8 |
9 | @if (showBanner)
10 | {
11 |
12 | Use this space to summarize your privacy and cookie use policy.
Learn More .
13 |
14 | Accept
15 |
16 |
17 |
25 | }
26 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | @ViewData["Title"] - WebPagesSample
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
42 |
43 |
44 |
45 | @RenderBody()
46 |
47 |
48 |
49 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
66 |
72 |
73 |
74 |
75 | @RenderSection("Scripts", required: false)
76 |
77 |
78 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using WebPagesSample
2 | @namespace WebPagesSample.Pages
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Pages/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace WebPagesSample
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | CreateWebHostBuilder(args).Build().Run();
18 | }
19 |
20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseStartup();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.Http;
8 | using Microsoft.AspNetCore.HttpsPolicy;
9 | using Microsoft.AspNetCore.Mvc;
10 | using Microsoft.Extensions.Configuration;
11 | using Microsoft.Extensions.DependencyInjection;
12 |
13 | namespace WebPagesSample
14 | {
15 | public class Startup
16 | {
17 | public Startup(IConfiguration configuration)
18 | {
19 | Configuration = configuration;
20 | }
21 |
22 | public IConfiguration Configuration { get; }
23 |
24 | public void ConfigureServices(IServiceCollection services)
25 | {
26 | services
27 | #if NET2
28 | .AddMvc()
29 | #else
30 | .AddRazorPages()
31 | #endif
32 | .AddForEvolveLocalization()
33 | ;
34 | }
35 |
36 | public void Configure(
37 | IApplicationBuilder app,
38 | #if NET2
39 | IHostingEnvironment env
40 | #else
41 | IWebHostEnvironment env
42 | #endif
43 | )
44 | {
45 | app.UseDeveloperExceptionPage();
46 | app.UseStaticFiles();
47 | app.UseRequestLocalization();
48 | #if NET2
49 | app.UseMvc();
50 | #else
51 | app.UseRouting();
52 | app.UseEndpoints(endpoints =>
53 | {
54 | endpoints.MapRazorPages();
55 | });
56 | #endif
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/WebPagesSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1;netcoreapp3.1;net5.0
5 | NET2
6 | NET3
7 | NET5
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning"
5 | }
6 | },
7 | "AllowedHosts": "*"
8 | }
9 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | for details on configuring this project to bundle and minify static web assets. */
3 |
4 | a.navbar-brand {
5 | white-space: normal;
6 | text-align: center;
7 | word-break: break-all;
8 | }
9 |
10 | /* Sticky footer styles
11 | -------------------------------------------------- */
12 | html {
13 | font-size: 14px;
14 | }
15 | @media (min-width: 768px) {
16 | html {
17 | font-size: 16px;
18 | }
19 | }
20 |
21 | .border-top {
22 | border-top: 1px solid #e5e5e5;
23 | }
24 | .border-bottom {
25 | border-bottom: 1px solid #e5e5e5;
26 | }
27 |
28 | .box-shadow {
29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
30 | }
31 |
32 | button.accept-policy {
33 | font-size: 1rem;
34 | line-height: inherit;
35 | }
36 |
37 | /* Sticky footer styles
38 | -------------------------------------------------- */
39 | html {
40 | position: relative;
41 | min-height: 100%;
42 | }
43 |
44 | body {
45 | /* Margin bottom by footer height */
46 | margin-bottom: 60px;
47 | }
48 | .footer {
49 | position: absolute;
50 | bottom: 0;
51 | width: 100%;
52 | white-space: nowrap;
53 | /* Set the fixed height of the footer here */
54 | height: 60px;
55 | line-height: 60px; /* Vertically center the text there */
56 | }
57 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ForEvolve/ForEvolve.AspNetCore.Localization/dd7d375acb7216885952208349cf1f968dd09455/samples/WebPagesSample/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your Javascript code.
5 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2018 Twitter, Inc.
4 | Copyright (c) 2011-2018 The Bootstrap Authors
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/)
3 | * Copyright 2011-2018 The Bootstrap Authors
4 | * Copyright 2011-2018 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */
8 | *,
9 | *::before,
10 | *::after {
11 | box-sizing: border-box;
12 | }
13 |
14 | html {
15 | font-family: sans-serif;
16 | line-height: 1.15;
17 | -webkit-text-size-adjust: 100%;
18 | -ms-text-size-adjust: 100%;
19 | -ms-overflow-style: scrollbar;
20 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
21 | }
22 |
23 | @-ms-viewport {
24 | width: device-width;
25 | }
26 |
27 | article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
28 | display: block;
29 | }
30 |
31 | body {
32 | margin: 0;
33 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
34 | font-size: 1rem;
35 | font-weight: 400;
36 | line-height: 1.5;
37 | color: #212529;
38 | text-align: left;
39 | background-color: #fff;
40 | }
41 |
42 | [tabindex="-1"]:focus {
43 | outline: 0 !important;
44 | }
45 |
46 | hr {
47 | box-sizing: content-box;
48 | height: 0;
49 | overflow: visible;
50 | }
51 |
52 | h1, h2, h3, h4, h5, h6 {
53 | margin-top: 0;
54 | margin-bottom: 0.5rem;
55 | }
56 |
57 | p {
58 | margin-top: 0;
59 | margin-bottom: 1rem;
60 | }
61 |
62 | abbr[title],
63 | abbr[data-original-title] {
64 | text-decoration: underline;
65 | -webkit-text-decoration: underline dotted;
66 | text-decoration: underline dotted;
67 | cursor: help;
68 | border-bottom: 0;
69 | }
70 |
71 | address {
72 | margin-bottom: 1rem;
73 | font-style: normal;
74 | line-height: inherit;
75 | }
76 |
77 | ol,
78 | ul,
79 | dl {
80 | margin-top: 0;
81 | margin-bottom: 1rem;
82 | }
83 |
84 | ol ol,
85 | ul ul,
86 | ol ul,
87 | ul ol {
88 | margin-bottom: 0;
89 | }
90 |
91 | dt {
92 | font-weight: 700;
93 | }
94 |
95 | dd {
96 | margin-bottom: .5rem;
97 | margin-left: 0;
98 | }
99 |
100 | blockquote {
101 | margin: 0 0 1rem;
102 | }
103 |
104 | dfn {
105 | font-style: italic;
106 | }
107 |
108 | b,
109 | strong {
110 | font-weight: bolder;
111 | }
112 |
113 | small {
114 | font-size: 80%;
115 | }
116 |
117 | sub,
118 | sup {
119 | position: relative;
120 | font-size: 75%;
121 | line-height: 0;
122 | vertical-align: baseline;
123 | }
124 |
125 | sub {
126 | bottom: -.25em;
127 | }
128 |
129 | sup {
130 | top: -.5em;
131 | }
132 |
133 | a {
134 | color: #007bff;
135 | text-decoration: none;
136 | background-color: transparent;
137 | -webkit-text-decoration-skip: objects;
138 | }
139 |
140 | a:hover {
141 | color: #0056b3;
142 | text-decoration: underline;
143 | }
144 |
145 | a:not([href]):not([tabindex]) {
146 | color: inherit;
147 | text-decoration: none;
148 | }
149 |
150 | a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
151 | color: inherit;
152 | text-decoration: none;
153 | }
154 |
155 | a:not([href]):not([tabindex]):focus {
156 | outline: 0;
157 | }
158 |
159 | pre,
160 | code,
161 | kbd,
162 | samp {
163 | font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
164 | font-size: 1em;
165 | }
166 |
167 | pre {
168 | margin-top: 0;
169 | margin-bottom: 1rem;
170 | overflow: auto;
171 | -ms-overflow-style: scrollbar;
172 | }
173 |
174 | figure {
175 | margin: 0 0 1rem;
176 | }
177 |
178 | img {
179 | vertical-align: middle;
180 | border-style: none;
181 | }
182 |
183 | svg {
184 | overflow: hidden;
185 | vertical-align: middle;
186 | }
187 |
188 | table {
189 | border-collapse: collapse;
190 | }
191 |
192 | caption {
193 | padding-top: 0.75rem;
194 | padding-bottom: 0.75rem;
195 | color: #6c757d;
196 | text-align: left;
197 | caption-side: bottom;
198 | }
199 |
200 | th {
201 | text-align: inherit;
202 | }
203 |
204 | label {
205 | display: inline-block;
206 | margin-bottom: 0.5rem;
207 | }
208 |
209 | button {
210 | border-radius: 0;
211 | }
212 |
213 | button:focus {
214 | outline: 1px dotted;
215 | outline: 5px auto -webkit-focus-ring-color;
216 | }
217 |
218 | input,
219 | button,
220 | select,
221 | optgroup,
222 | textarea {
223 | margin: 0;
224 | font-family: inherit;
225 | font-size: inherit;
226 | line-height: inherit;
227 | }
228 |
229 | button,
230 | input {
231 | overflow: visible;
232 | }
233 |
234 | button,
235 | select {
236 | text-transform: none;
237 | }
238 |
239 | button,
240 | html [type="button"],
241 | [type="reset"],
242 | [type="submit"] {
243 | -webkit-appearance: button;
244 | }
245 |
246 | button::-moz-focus-inner,
247 | [type="button"]::-moz-focus-inner,
248 | [type="reset"]::-moz-focus-inner,
249 | [type="submit"]::-moz-focus-inner {
250 | padding: 0;
251 | border-style: none;
252 | }
253 |
254 | input[type="radio"],
255 | input[type="checkbox"] {
256 | box-sizing: border-box;
257 | padding: 0;
258 | }
259 |
260 | input[type="date"],
261 | input[type="time"],
262 | input[type="datetime-local"],
263 | input[type="month"] {
264 | -webkit-appearance: listbox;
265 | }
266 |
267 | textarea {
268 | overflow: auto;
269 | resize: vertical;
270 | }
271 |
272 | fieldset {
273 | min-width: 0;
274 | padding: 0;
275 | margin: 0;
276 | border: 0;
277 | }
278 |
279 | legend {
280 | display: block;
281 | width: 100%;
282 | max-width: 100%;
283 | padding: 0;
284 | margin-bottom: .5rem;
285 | font-size: 1.5rem;
286 | line-height: inherit;
287 | color: inherit;
288 | white-space: normal;
289 | }
290 |
291 | progress {
292 | vertical-align: baseline;
293 | }
294 |
295 | [type="number"]::-webkit-inner-spin-button,
296 | [type="number"]::-webkit-outer-spin-button {
297 | height: auto;
298 | }
299 |
300 | [type="search"] {
301 | outline-offset: -2px;
302 | -webkit-appearance: none;
303 | }
304 |
305 | [type="search"]::-webkit-search-cancel-button,
306 | [type="search"]::-webkit-search-decoration {
307 | -webkit-appearance: none;
308 | }
309 |
310 | ::-webkit-file-upload-button {
311 | font: inherit;
312 | -webkit-appearance: button;
313 | }
314 |
315 | output {
316 | display: inline-block;
317 | }
318 |
319 | summary {
320 | display: list-item;
321 | cursor: pointer;
322 | }
323 |
324 | template {
325 | display: none;
326 | }
327 |
328 | [hidden] {
329 | display: none !important;
330 | }
331 | /*# sourceMappingURL=bootstrap-reboot.css.map */
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/)
3 | * Copyright 2011-2018 The Bootstrap Authors
4 | * Copyright 2011-2018 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) .NET Foundation. All rights reserved.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 | these files except in compliance with the License. You may obtain a copy of the
5 | License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software distributed
10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 | specific language governing permissions and limitations under the License.
13 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js:
--------------------------------------------------------------------------------
1 | // Unobtrusive validation support library for jQuery and jQuery Validate
2 | // Copyright (c) .NET Foundation. All rights reserved.
3 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
4 | // @version v3.2.11
5 | !function(a){"function"==typeof define&&define.amd?define("jquery.validate.unobtrusive",["jquery-validation"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery-validation")):jQuery.validator.unobtrusive=a(jQuery)}(function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a(" ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function u(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=f.unobtrusive.options||{},u=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),u("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),u("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),u("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var m,f=a.validator,v="unobtrusiveValidation";return f.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=u(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){f.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=u(this);a&&a.attachValidation()})}},m=f.unobtrusive.adapters,m.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},m.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},m.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},m.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},f.addMethod("__dummy__",function(a,e,n){return!0}),f.addMethod("regex",function(a,e,n){var t;return!!this.optional(e)||(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),f.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),f.methods.extension?(m.addSingleVal("accept","mimtype"),m.addSingleVal("extension","extension")):m.addSingleVal("extension","extension","accept"),m.addSingleVal("regex","pattern"),m.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),m.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),m.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),m.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),m.add("required",function(a){"INPUT"===a.element.tagName.toUpperCase()&&"CHECKBOX"===a.element.type.toUpperCase()||e(a,"required",!0)}),m.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),m.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),m.add("fileextensions",["extensions"],function(a){e(a,"extension",a.params.extensions)}),a(function(){f.unobtrusive.parse(document)}),f.unobtrusive});
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/samples/WebPagesSample/wwwroot/lib/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright JS Foundation and other contributors, https://js.foundation/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | All files located in the node_modules and external directories are
34 | externally maintained libraries used by this software which have their
35 | own licenses; we recommend you read them, as their terms may differ from
36 | the terms above.
37 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Adapters/BaseLocalizationValidationAttributeAdapter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace ForEvolve.AspNetCore.Localization.Adapters
5 | {
6 | public abstract class BaseLocalizationValidationAttributeAdapter : ILocalizationValidationAttributeAdapter
7 | where TValidationAttribute : ValidationAttribute
8 | {
9 | public virtual bool CanHandle(ValidationAttribute attribute)
10 | {
11 | return attribute is TValidationAttribute;
12 | }
13 |
14 | public virtual string GetErrorMessageResourceName(ValidationAttribute attribute)
15 | {
16 | return InternalGetErrorMessageResourceName(attribute as TValidationAttribute);
17 | }
18 |
19 | protected abstract string InternalGetErrorMessageResourceName(TValidationAttribute attr);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Adapters/DefaultLocalizationValidationAttributeAdapter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.ComponentModel.DataAnnotations;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace ForEvolve.AspNetCore.Localization.Adapters
10 | {
11 | public class DefaultLocalizationValidationAttributeAdapter : ILocalizationValidationAttributeAdapter
12 | {
13 | private readonly string[] _supportedAttributes = new string[]
14 | {
15 | nameof(CompareAttribute),
16 | nameof(EmailAddressAttribute),
17 | nameof(RequiredAttribute),
18 | nameof(CreditCardAttribute),
19 | nameof(FileExtensionsAttribute),
20 | nameof(MaxLengthAttribute),
21 | nameof(MinLengthAttribute),
22 | nameof(PhoneAttribute),
23 | nameof(RangeAttribute),
24 | nameof(RegularExpressionAttribute),
25 | nameof(UrlAttribute)
26 | };
27 |
28 | public bool CanHandle(ValidationAttribute attribute)
29 | {
30 | return _supportedAttributes.Contains(attribute.GetType().Name);
31 | }
32 |
33 | public string GetErrorMessageResourceName(ValidationAttribute attribute)
34 | {
35 | return $"{attribute.GetType().Name}_ErrorMessage";
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Adapters/StringLengthLocalizationValidationAttributeAdapter.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace ForEvolve.AspNetCore.Localization.Adapters
4 | {
5 | public class StringLengthLocalizationValidationAttributeAdapter : BaseLocalizationValidationAttributeAdapter
6 | {
7 | public const string DefaultResourceName = "StringLengthAttribute_ErrorMessage";
8 | public const string ResourceNameIncludingMinimum = "StringLengthAttribute_ErrorMessageIncludingMinimum";
9 |
10 | protected override string InternalGetErrorMessageResourceName(StringLengthAttribute attr)
11 | {
12 | if (attr.MinimumLength > 0)
13 | {
14 | return ResourceNameIncludingMinimum;
15 | }
16 | else
17 | {
18 | return DefaultResourceName;
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/ForEvolve.AspNetCore.Localization.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | True
6 | False
7 | Carl-Hugo Marcotte
8 | ForEvolve
9 | https://github.com/ForEvolve/ForEvolve.AspNetCore.Localization
10 | MIT
11 | Carl-Hugo Marcotte
12 | true
13 | true
14 | True
15 | snupkg
16 | The ForEvolve.AspNetCore.Localization package allows you to enable localization of Asp.Net Core 2.1+ applications in one line of code. Moreover, it translates `System.ComponentModel.DataAnnotations.ValidationAttribute`s automagically, without the need to specify any string or error message (like the `[Required]` attribute).
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | 3.2.7-beta
27 | all
28 |
29 |
30 |
31 |
32 |
33 | DataAnnotationSharedResource.resx
34 | True
35 | True
36 |
37 |
38 |
39 |
40 |
41 | DataAnnotationSharedResource.Designer.cs
42 | ResXFileCodeGenerator
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/ForEvolveLocalizationValidationMetadataProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.DataAnnotations;
5 | using System.Linq;
6 |
7 | namespace ForEvolve.AspNetCore.Localization
8 | {
9 | public class ForEvolveLocalizationValidationMetadataProvider : ILocalizationValidationMetadataProvider
10 | {
11 | public Type ErrorMessageResourceType { get; }
12 | public IList Adapters { get; }
13 |
14 | public ForEvolveLocalizationValidationMetadataProvider(IEnumerable adapters)
15 | {
16 | Adapters = new List(adapters ?? Enumerable.Empty());
17 | ErrorMessageResourceType = typeof(TErrorMessageResource);
18 | }
19 |
20 | public void CreateValidationMetadata(ValidationMetadataProviderContext context)
21 | {
22 | foreach (var attr in context.Attributes)
23 | {
24 | if (attr is ValidationAttribute validationAttr)
25 | {
26 | // If there is no custom message, try to find an adapter to set
27 | // the ErrorMessageResourceName property automatically.
28 | var hasNoCustomErrorMessage = string.IsNullOrWhiteSpace(validationAttr.ErrorMessage);
29 | var isDataTypeAttribute = validationAttr is DataTypeAttribute;
30 | if (hasNoCustomErrorMessage || isDataTypeAttribute)
31 | {
32 | foreach (var adapter in Adapters)
33 | {
34 | if (adapter.CanHandle(validationAttr))
35 | {
36 | validationAttr.ErrorMessageResourceType = ErrorMessageResourceType;
37 | validationAttr.ErrorMessageResourceName = adapter.GetErrorMessageResourceName(validationAttr);
38 | break;
39 | }
40 | }
41 | }
42 | }
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/ILocalizationValidationAttributeAdapter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace ForEvolve.AspNetCore.Localization
5 | {
6 | public interface ILocalizationValidationAttributeAdapter
7 | {
8 | string GetErrorMessageResourceName(ValidationAttribute attribute);
9 | bool CanHandle(ValidationAttribute attribute);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/ILocalizationValidationMetadataProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
2 | using System.Collections.Generic;
3 |
4 | namespace ForEvolve.AspNetCore.Localization
5 | {
6 | public interface ILocalizationValidationMetadataProvider : IValidationMetadataProvider
7 | {
8 | IList Adapters { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/ISupportedCulturesCollection.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Globalization;
3 |
4 | namespace ForEvolve.AspNetCore.Localization
5 | {
6 | public interface ISupportedCulturesCollection : IReadOnlyList
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/LocalizationOptionsInitializer.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Localization;
2 | using Microsoft.Extensions.Options;
3 |
4 | namespace ForEvolve.AspNetCore.Localization
5 | {
6 | public class LocalizationOptionsInitializer : IConfigureOptions
7 | {
8 | public const string DefaultResourcesPath = "Resources";
9 |
10 | public void Configure(LocalizationOptions options)
11 | {
12 | options.ResourcesPath = DefaultResourcesPath;
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/MvcOptionsInitializer.cs:
--------------------------------------------------------------------------------
1 | using ForEvolve.AspNetCore.Localization.Resources;
2 | using Microsoft.AspNetCore.Builder;
3 | using Microsoft.AspNetCore.Mvc;
4 | using Microsoft.Extensions.Options;
5 | using System;
6 |
7 | namespace ForEvolve.AspNetCore.Localization
8 | {
9 |
10 | public class MvcOptionsInitializer : IConfigureOptions
11 | {
12 | private readonly ILocalizationValidationMetadataProvider _defaultValidationMetadataProvider;
13 | public MvcOptionsInitializer(ILocalizationValidationMetadataProvider defaultValidationMetadataProvider)
14 | {
15 | _defaultValidationMetadataProvider = defaultValidationMetadataProvider ?? throw new ArgumentNullException(nameof(defaultValidationMetadataProvider));
16 | }
17 |
18 | public void Configure(MvcOptions options)
19 | {
20 | options.ModelMetadataDetailsProviders.Add(_defaultValidationMetadataProvider);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/RequestLocalizationOptionsInitializer.cs:
--------------------------------------------------------------------------------
1 | using ForEvolve.AspNetCore.Localization;
2 | using Microsoft.AspNetCore.Builder;
3 | using Microsoft.AspNetCore.Localization;
4 | using Microsoft.Extensions.Options;
5 | using System;
6 | using System.Globalization;
7 | using System.Linq;
8 |
9 | namespace Microsoft.Extensions.DependencyInjection
10 | {
11 | public class RequestLocalizationOptionsInitializer : IConfigureOptions
12 | {
13 | private readonly ISupportedCulturesCollection _supportedCultures;
14 | private readonly CultureInfo _defaultCulture;
15 | public RequestLocalizationOptionsInitializer(ISupportedCulturesCollection supportedCultures)
16 | {
17 | _supportedCultures = supportedCultures ?? throw new ArgumentNullException(nameof(supportedCultures));
18 | _defaultCulture = _supportedCultures.First();
19 | }
20 |
21 | public void Configure(RequestLocalizationOptions options)
22 | {
23 | // State what the default culture for your application is. This will be used if no specific culture
24 | // can be determined for a given request.
25 | options.DefaultRequestCulture = new RequestCulture(_defaultCulture, _defaultCulture);
26 |
27 | // You must explicitly state which cultures your application supports.
28 | // These are the cultures the app supports for formatting numbers, dates, etc.
29 | options.SupportedCultures = _supportedCultures.ToList();
30 |
31 | // These are the cultures the app supports for UI strings, i.e. we have localized resources for.
32 | options.SupportedUICultures = _supportedCultures.ToList();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ForEvolve.AspNetCore.Localization.Resources {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class DataAnnotationSharedResource {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal DataAnnotationSharedResource() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ForEvolve.AspNetCore.Localization.Resources.DataAnnotationSharedResource", typeof(DataAnnotationSharedResource).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to '{0}' and '{1}' do not match..
65 | ///
66 | internal static string CompareAttribute_ErrorMessage {
67 | get {
68 | return ResourceManager.GetString("CompareAttribute_ErrorMessage", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to The {0} field is not a valid credit card number..
74 | ///
75 | internal static string CreditCardAttribute_ErrorMessage {
76 | get {
77 | return ResourceManager.GetString("CreditCardAttribute_ErrorMessage", resourceCulture);
78 | }
79 | }
80 |
81 | ///
82 | /// Looks up a localized string similar to The {0} field is not a valid e-mail address..
83 | ///
84 | internal static string EmailAddressAttribute_ErrorMessage {
85 | get {
86 | return ResourceManager.GetString("EmailAddressAttribute_ErrorMessage", resourceCulture);
87 | }
88 | }
89 |
90 | ///
91 | /// Looks up a localized string similar to The {0} field only accepts files with the following extensions: {1}.
92 | ///
93 | internal static string FileExtensionsAttribute_ErrorMessage {
94 | get {
95 | return ResourceManager.GetString("FileExtensionsAttribute_ErrorMessage", resourceCulture);
96 | }
97 | }
98 |
99 | ///
100 | /// Looks up a localized string similar to The field {0} must be a string or array type with a maximum length of '{1}'..
101 | ///
102 | internal static string MaxLengthAttribute_ErrorMessage {
103 | get {
104 | return ResourceManager.GetString("MaxLengthAttribute_ErrorMessage", resourceCulture);
105 | }
106 | }
107 |
108 | ///
109 | /// Looks up a localized string similar to The field {0} must be a string or array type with a minimum length of '{1}'..
110 | ///
111 | internal static string MinLengthAttribute_ErrorMessage {
112 | get {
113 | return ResourceManager.GetString("MinLengthAttribute_ErrorMessage", resourceCulture);
114 | }
115 | }
116 |
117 | ///
118 | /// Looks up a localized string similar to The {0} field is not a valid phone number..
119 | ///
120 | internal static string PhoneAttribute_ErrorMessage {
121 | get {
122 | return ResourceManager.GetString("PhoneAttribute_ErrorMessage", resourceCulture);
123 | }
124 | }
125 |
126 | ///
127 | /// Looks up a localized string similar to The field {0} must be between {1} and {2}..
128 | ///
129 | internal static string RangeAttribute_ErrorMessage {
130 | get {
131 | return ResourceManager.GetString("RangeAttribute_ErrorMessage", resourceCulture);
132 | }
133 | }
134 |
135 | ///
136 | /// Looks up a localized string similar to The field {0} must match the regular expression '{1}'..
137 | ///
138 | internal static string RegularExpressionAttribute_ErrorMessage {
139 | get {
140 | return ResourceManager.GetString("RegularExpressionAttribute_ErrorMessage", resourceCulture);
141 | }
142 | }
143 |
144 | ///
145 | /// Looks up a localized string similar to The {0} field is required..
146 | ///
147 | internal static string RequiredAttribute_ErrorMessage {
148 | get {
149 | return ResourceManager.GetString("RequiredAttribute_ErrorMessage", resourceCulture);
150 | }
151 | }
152 |
153 | ///
154 | /// Looks up a localized string similar to The {0} must be at maximum {1} characters long..
155 | ///
156 | internal static string StringLengthAttribute_ErrorMessage {
157 | get {
158 | return ResourceManager.GetString("StringLengthAttribute_ErrorMessage", resourceCulture);
159 | }
160 | }
161 |
162 | ///
163 | /// Looks up a localized string similar to The {0} must be at least {2} and at maximum {1} characters long..
164 | ///
165 | internal static string StringLengthAttribute_ErrorMessageIncludingMinimum {
166 | get {
167 | return ResourceManager.GetString("StringLengthAttribute_ErrorMessageIncludingMinimum", resourceCulture);
168 | }
169 | }
170 |
171 | ///
172 | /// Looks up a localized string similar to The {0} field is not a valid fully-qualified http, https, or ftp URL..
173 | ///
174 | internal static string UrlAttribute_ErrorMessage {
175 | get {
176 | return ResourceManager.GetString("UrlAttribute_ErrorMessage", resourceCulture);
177 | }
178 | }
179 | }
180 | }
181 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.es.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' y '{1}' no coinciden
122 |
123 |
124 | El campo {0} no es un número de tarjeta de crédito válido
125 |
126 |
127 | El campo {0} no es una direción de correo válida
128 |
129 |
130 | El campo {0} sólo acepta archivos con las siguientes extensiones {1}
131 |
132 |
133 | El campo {0} debe tener una longitud máxima de {1}
134 |
135 |
136 | El campo {0} debe tener una longitud mínima de {1}
137 |
138 |
139 | El campo {0} no tiene un número de teléfono válido
140 |
141 |
142 | El campo {0} debe estar entre {1} y {2}
143 |
144 |
145 | El campo {0} debe coincidir con la expresión regular {1}
146 |
147 |
148 | El campo {0} es obligatorio
149 |
150 |
151 | El campo {0} debe tener una longitud máxima de {1}
152 |
153 |
154 | La longitus del campo {0} debe estar entre {1} y {2} caracteres
155 |
156 |
157 | El campo {0} no es una URL válida de http, https, o ftp
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.fr.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Les champs '{0}' et '{1}' ne sont pas identiques.
122 |
123 |
124 | Le champ {0} est un numéro de carte de crédit invalide.
125 |
126 |
127 | Le champ {0} est une adresse courriel invalide.
128 |
129 |
130 | Le champ {0} accepte uniquement les fichiers aux extensions suivantes: {1}
131 |
132 |
133 | Le champ {0} doit avoir une longueur maximum de '{1}'.
134 |
135 |
136 | Le champ {0} doit avoir une longueur minimum de '{1}'.
137 |
138 |
139 | Le champ {0} est un numéro de téléphone invalide.
140 |
141 |
142 | Le champ {0} doit être entre {1} et {2}.
143 |
144 |
145 | Le champ {0} doit correspondre à l'expression régulière '{1}'.
146 |
147 |
148 | Le champ {0} est requis.
149 |
150 |
151 | Le champ {0} doit être composé d'un maximum de {1} caractères.
152 |
153 |
154 | Le champ {0} doit être entre {2} et {1} caractères.
155 |
156 |
157 | Le champ {0} n'est pas une URL pleinement qualifiée valide, commençant par HTTP, HTTP ou FTP.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.he.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' ו '{1}' לא מתאימים.
122 |
123 |
124 | מספר כרטיס אשראי שגוי בשדה {0}
125 |
126 |
127 | כתובת דואר שגוייה בשדה {0}
128 |
129 |
130 | סיומת קובץ לא תקינה, ניתן רק {1} , שדה {0}
131 |
132 |
133 | אורך מקסימלי לשדה {0} הוא {1}
134 |
135 |
136 | אורך מינימלי לשדה {0} הוא {1}
137 |
138 |
139 | מספר טלפון לא תקין, שדה {0}
140 |
141 |
142 | השדה {0} חייב להיות בין {1} ל-{2}
143 |
144 |
145 | השדה {0} לא מתאים לתנאי הבדיקה '{1}'
146 |
147 |
148 | שדה חובה {0}
149 |
150 |
151 | אורך מקסימלי לשדה {0} הוא {1}
152 |
153 |
154 | השדה {0} חייב להיות לפחות {2} ולא יותר מ {1}
155 |
156 |
157 | השדה {0} לא תקין לכתובת http, https, או ftp URL.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.nb.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' og '{1}' er ikke like.
122 |
123 |
124 | Feltet {0} inneholder ikke et gyldig kredittkortnummer.
125 |
126 |
127 | Feltet {0} inneholder ikke en gyldig e-postadresse.
128 |
129 |
130 | Feltet {0} tillater kun filer med følgende filendinger: {1}
131 |
132 |
133 | Feltet {0} må være av typen string eller array og ikke lengre enn '{1}'.
134 |
135 |
136 | Feltet {0} må være av typen string eller array med minimumlengde '{1}'.
137 |
138 |
139 | Feltet {0} inneholder ikke et gyldig telefonnummer.
140 |
141 |
142 | Feltet {0} må være mellom {1} og {2}.
143 |
144 |
145 | Feltet {0} må samsvare med det regulære uttrykket (regex): '{1}'.
146 |
147 |
148 | Feltet {0} er påkrevd.
149 |
150 |
151 | Feltet {0} kan ikke ha mer enn {1} tegn.
152 |
153 |
154 | Feltet {0} må inneholde minst {2} og ikke mer enn {1} tegn.
155 |
156 |
157 | Feltet {0} er ikke en gyldig, fullt kvalifisert http-, https-, eller ftp-URL.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.no.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' og '{1}' er ikke like.
122 |
123 |
124 | Feltet {0} inneholder ikke et gyldig kredittkortnummer.
125 |
126 |
127 | Feltet {0} inneholder ikke en gyldig e-postadresse.
128 |
129 |
130 | Feltet {0} tillater kun filer med følgende filendinger: {1}
131 |
132 |
133 | Feltet {0} må være av typen string eller array og ikke lengre enn '{1}'.
134 |
135 |
136 | Feltet {0} må være av typen string eller array med minimumlengde '{1}'.
137 |
138 |
139 | Feltet {0} inneholder ikke et gyldig telefonnummer.
140 |
141 |
142 | Feltet {0} må være mellom {1} og {2}.
143 |
144 |
145 | Feltet {0} må samsvare med det regulære uttrykket (regex): '{1}'.
146 |
147 |
148 | Feltet {0} er påkrevd.
149 |
150 |
151 | Feltet {0} kan ikke ha mer enn {1} tegn.
152 |
153 |
154 | Feltet {0} må inneholde minst {2} og ikke mer enn {1} tegn.
155 |
156 |
157 | Feltet {0} er ikke en gyldig, fullt kvalifisert http-, https-, eller ftp-URL.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.pl.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Pole {0} oraz {1} muszą być identyczne.
122 |
123 |
124 | Pole {0} musi być w zakresie od {1} do {2}.
125 |
126 |
127 | Pole {0} musi pasować do wyrażenia regularnego {1}.
128 |
129 |
130 | Pole {0} jest wymagane.
131 |
132 |
133 | Pole {0} musi być ciągiem o maksymalnej długości {1}.
134 |
135 |
136 | Pole {0} musi być ciągiem o długości od {2} do {1} znaków.
137 |
138 |
139 | Pole {0} ma niepoprawny numer karty płatniczej.
140 |
141 |
142 | Pole {0} ma niepoprawny adres email.
143 |
144 |
145 | Pole {0} przyjmuje tylko pliki typów: {1}
146 |
147 |
148 | Pole {0} może zawierać maksymalnie {1} elementów lub znaków.
149 |
150 |
151 | Pole {0} musi zawierać przynajmniej {1} elementów lub znaków.
152 |
153 |
154 | Pole {0} ma niepoprawny numer telefonu.
155 |
156 |
157 | Pole {0} musi być poprawnym adresem URL.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.pt-BR.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' e '{1}' não correspondem.
122 |
123 |
124 | O campo {0} não é um número de cartão de crédito válido.
125 |
126 |
127 | O campo {0} não é um e-mail válido.
128 |
129 |
130 | O campo {0} somente aceita arquivos com as seguintes extensões: {1}
131 |
132 |
133 | O campo {0} deve ser um array ou string com o tamanho máximo de '{1}'.
134 |
135 |
136 | O campo {0} deve ser um array ou string com o tamanho mínimo de '{1}'.
137 |
138 |
139 | O campo {0} não é um número de telefone válido.
140 |
141 |
142 | O campo {0} deve conter um valor entre {1} e {2}.
143 |
144 |
145 | O campo {0} deve obedecer a expressão regular '{1}'.
146 |
147 |
148 | O campo {0} é obrigatório.
149 |
150 |
151 | O campo {0} deve ter no máximo {1} caracteres.
152 |
153 |
154 | O campo {0} deve ter pelo menos {2} a até {1} caracteres.
155 |
156 |
157 | O campo {0} não é uma URL http, https, ou ftp URL válida.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.pt.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' e '{1}' não correspondem.
122 |
123 |
124 | O campo {0} não é um número de cartão de crédito válido.
125 |
126 |
127 | O campo {0} não é um e-mail válido.
128 |
129 |
130 | O campo {0} somente aceita arquivos com as seguintes extensões: {1}
131 |
132 |
133 | O campo {0} deve ser um array ou string com o tamanho máximo de '{1}'.
134 |
135 |
136 | O campo {0} deve ser um array ou string com o tamanho mínimo de '{1}'.
137 |
138 |
139 | O campo {0} não é um número de telefone válido.
140 |
141 |
142 | O campo {0} deve conter um valor entre {1} e {2}.
143 |
144 |
145 | O campo {0} deve obedecer a expressão regular '{1}'.
146 |
147 |
148 | O campo {0} é obrigatório.
149 |
150 |
151 | O campo {0} deve ter no máximo {1} caracteres.
152 |
153 |
154 | O campo {0} deve ter pelo menos {2} a até {1} caracteres.
155 |
156 |
157 | O campo {0} não é uma URL http, https, ou ftp URL válida.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.resx:
--------------------------------------------------------------------------------
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 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | text/microsoft-resx
51 |
52 |
53 | 2.0
54 |
55 |
56 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
57 |
58 |
59 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
60 |
61 |
62 | '{0}' and '{1}' do not match.
63 |
64 |
65 | The {0} field is not a valid credit card number.
66 |
67 |
68 | The {0} field is not a valid e-mail address.
69 |
70 |
71 | The {0} field only accepts files with the following extensions: {1}
72 |
73 |
74 | The field {0} must be a string or array type with a maximum length of '{1}'.
75 |
76 |
77 | The field {0} must be a string or array type with a minimum length of '{1}'.
78 |
79 |
80 | The {0} field is not a valid phone number.
81 |
82 |
83 | The field {0} must be between {1} and {2}.
84 |
85 |
86 | The field {0} must match the regular expression '{1}'.
87 |
88 |
89 | The {0} field is required.
90 |
91 |
92 | The {0} must be at maximum {1} characters long.
93 |
94 |
95 | The {0} must be at least {2} and at maximum {1} characters long.
96 |
97 |
98 | The {0} field is not a valid fully-qualified http, https, or ftp URL.
99 |
100 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.zh-Hant.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' 欄位 及 '{1}' 欄位 資料不一致.
122 |
123 |
124 | {0} 欄位 不是正確的信用卡卡號格式.
125 |
126 |
127 | {0} 欄位 不是正確的Email格式.
128 |
129 |
130 | {0} 欄位 只接受下列副檔名: {1}
131 |
132 |
133 | {0} 欄位 長度最多為 '{1}'.
134 |
135 |
136 | {0} 欄位 長度最少為 '{1}'.
137 |
138 |
139 | {0} 欄位 不是正確的電話號碼格式.
140 |
141 |
142 | {0} 欄位 必須藉再 {1} 跟 {2} 之間.
143 |
144 |
145 | {0} 欄位 不符合正規表式 '{1}'.
146 |
147 |
148 | {0} 欄位為必填.
149 |
150 |
151 | {0} 欄位的長度 最長 {1} 個字元.
152 |
153 |
154 | {0} 欄位 字元長度必須在 {2} 跟 {1} 之間.
155 |
156 |
157 | {0} 欄位 不是一個正確的 http, https, 或 ftp 網址.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.zh-TW.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' 欄位 及 '{1}' 欄位 資料不一致.
122 |
123 |
124 | {0} 欄位 不是正確的信用卡卡號格式.
125 |
126 |
127 | {0} 欄位 不是正確的Email格式.
128 |
129 |
130 | {0} 欄位 只接受下列副檔名: {1}
131 |
132 |
133 | {0} 欄位 長度最多為 '{1}'.
134 |
135 |
136 | {0} 欄位 長度最少為 '{1}'.
137 |
138 |
139 | {0} 欄位 不是正確的電話號碼格式.
140 |
141 |
142 | {0} 欄位 必須藉再 {1} 跟 {2} 之間.
143 |
144 |
145 | {0} 欄位 不符合正規表式 '{1}'.
146 |
147 |
148 | {0} 欄位為必填.
149 |
150 |
151 | {0} 欄位的長度 最長 {1} 個字元.
152 |
153 |
154 | {0} 欄位 字元長度必須在 {2} 跟 {1} 之間.
155 |
156 |
157 | {0} 欄位 不是一個正確的 http, https, 或 ftp 網址.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/Resources/DataAnnotationSharedResource.zh.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' 欄位 及 '{1}' 欄位 資料不一致.
122 |
123 |
124 | {0} 欄位 不是正確的信用卡卡號格式.
125 |
126 |
127 | {0} 欄位 不是正確的Email格式.
128 |
129 |
130 | {0} 欄位 只接受下列副檔名: {1}
131 |
132 |
133 | {0} 欄位 長度最多為 '{1}'.
134 |
135 |
136 | {0} 欄位 長度最少為 '{1}'.
137 |
138 |
139 | {0} 欄位 不是正確的電話號碼格式.
140 |
141 |
142 | {0} 欄位 必須藉再 {1} 跟 {2} 之間.
143 |
144 |
145 | {0} 欄位 不符合正規表式 '{1}'.
146 |
147 |
148 | {0} 欄位為必填.
149 |
150 |
151 | {0} 欄位的長度 最長 {1} 個字元.
152 |
153 |
154 | {0} 欄位 字元長度必須在 {2} 跟 {1} 之間.
155 |
156 |
157 | {0} 欄位 不是一個正確的 http, https, 或 ftp 網址.
158 |
159 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/StartupExtensions.cs:
--------------------------------------------------------------------------------
1 | using ForEvolve.AspNetCore.Localization;
2 | using ForEvolve.AspNetCore.Localization.Adapters;
3 | using ForEvolve.AspNetCore.Localization.Resources;
4 | using Microsoft.AspNetCore.Builder;
5 | using Microsoft.AspNetCore.Mvc;
6 | using Microsoft.Extensions.Localization;
7 | using Microsoft.Extensions.Options;
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 |
12 | namespace Microsoft.Extensions.DependencyInjection
13 | {
14 | public static class ForEvolveLocalizationStartupExtensions
15 | {
16 | ///
17 | /// Adds services required for application localization.
18 | /// The Asp.Net Core AddLocalization() method will be called.
19 | ///
20 | /// The Microsoft.Extensions.DependencyInjection.IServiceCollection to add the services to.
21 | /// The Microsoft.Extensions.DependencyInjection.IServiceCollection so that additional calls can be chained.
22 | [Obsolete(@"You can delete the call to this extension method.
23 | Use the IMvcBuilder.AddForEvolveMvcLocalization() extension method instead.
24 |
25 | This method will be removed in a future major release.", error: false)]
26 | public static IServiceCollection AddForEvolveLocalization(this IServiceCollection services)
27 | {
28 | return services;
29 | }
30 |
31 | ///
32 | /// Adds services required for application localization.
33 | /// The Asp.Net Core AddLocalization() method will be called.
34 | ///
35 | /// The Microsoft.Extensions.DependencyInjection.IServiceCollection to add the services to.
36 | /// An System.Action<ForEvolveLocalizationOptions> to configure the ForEvolve.AspNetCore.Localization.ForEvolveLocalizationOptions.
37 | /// The Microsoft.Extensions.DependencyInjection.IServiceCollection so that additional calls can be chained.
38 | [Obsolete(@"You can delete the call to this extension method.
39 | Use the IMvcBuilder.AddForEvolveMvcLocalization() extension method instead.
40 | The ForEvolveLocalizationOptions class has also been removed.
41 |
42 | This method will be removed in a future major release.", error: true)]
43 | public static IServiceCollection AddForEvolveLocalization(this IServiceCollection services, Action setupAction)
44 | {
45 | return services;
46 | }
47 |
48 | [Obsolete("Call IMvcBuilder.AddForEvolveLocalization() instead; this method will be removed in a future major release.", error: false)]
49 | public static IMvcBuilder AddForEvolveMvcLocalization(this IMvcBuilder mvcBuilder)
50 | {
51 | return AddForEvolveLocalization(mvcBuilder);
52 | }
53 |
54 | ///
55 | /// Adds services required for application localization.
56 | /// Calls the IServiceCollection.AddLocalization() method.
57 | /// Registers an IMetadataDetailsProvider that handles validation attributes to Microsoft.AspNetCore.Mvc.MvcOptions.
58 | /// Calls AddViewLocalization() and AddDataAnnotationsLocalization() on the IMvcBuilder (you can opt-out by configuring the options).
59 | ///
60 | /// The Microsoft.Extensions.DependencyInjection.IMvcBuilder.
61 | /// The Microsoft.Extensions.DependencyInjection.IMvcBuilder so that additional calls can be chained.
62 | public static IMvcBuilder AddForEvolveLocalization(this IMvcBuilder mvcBuilder)
63 | {
64 | return AddForEvolveLocalization(
65 | mvcBuilder,
66 | enableViewLocalization: true,
67 | enableDataAnnotationsLocalization: true
68 | );
69 | }
70 |
71 | ///
72 | /// Adds services required for application localization.
73 | /// Calls the IServiceCollection.AddLocalization() method.
74 | /// Registers an IMetadataDetailsProvider that handles validation attributes to Microsoft.AspNetCore.Mvc.MvcOptions.
75 | ///
76 | /// The Microsoft.Extensions.DependencyInjection.IMvcBuilder.
77 | /// true to call on , otherwise false.
78 | /// true to call on , otherwise false.
79 | /// The so that additional calls can be chained.
80 | public static IMvcBuilder AddForEvolveLocalization(this IMvcBuilder mvcBuilder, bool enableViewLocalization, bool enableDataAnnotationsLocalization)
81 | {
82 | // New registration
83 | var services = mvcBuilder.Services;
84 | services
85 | // Configure ForEvolve.AspNetCore.Localization
86 | .AddSingleton()
87 | .AddSingleton>()
88 | .AddSingleton()
89 | .AddSingleton()
90 |
91 | // Add custom options initializers to configures Asp.Net Core
92 | .AddSingleton, RequestLocalizationOptionsInitializer>()
93 | .AddSingleton, LocalizationOptionsInitializer>()
94 | .AddSingleton, MvcOptionsInitializer>()
95 |
96 | // Adds services required for application localization.
97 | .AddLocalization()
98 | ;
99 |
100 | if (enableViewLocalization) { mvcBuilder.AddViewLocalization(); }
101 | if (enableDataAnnotationsLocalization) { mvcBuilder.AddDataAnnotationsLocalization(); }
102 |
103 | return mvcBuilder;
104 | }
105 |
106 | ///
107 | /// Adds the Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware to automatically set culture information for requests based on information provided by the client.
108 | /// This calls UseRequestLocalization().
109 | ///
110 | /// The Microsoft.AspNetCore.Builder.IApplicationBuilder.
111 | /// The Microsoft.AspNetCore.Builder.IApplicationBuilder so that additional calls can be chained..
112 | [Obsolete("Call the IApplicationBuilder.UseRequestLocalization() extension method instead. This will be deleted in a next major version.", error: false)]
113 | public static IApplicationBuilder UseForEvolveRequestLocalization(this IApplicationBuilder app)
114 | {
115 | return app.UseRequestLocalization();
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/src/ForEvolve.AspNetCore.Localization/SupportedCulturesCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Collections.Immutable;
5 | using System.Globalization;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace ForEvolve.AspNetCore.Localization
11 | {
12 | public class SupportedCulturesCollection : ISupportedCulturesCollection
13 | {
14 | private static readonly ImmutableList _supportedCultures = new[]
15 | {
16 | new CultureInfo("en"),
17 | new CultureInfo("fr"),
18 | new CultureInfo("he"),
19 | new CultureInfo("pt"),
20 | new CultureInfo("pt-BR"),
21 | new CultureInfo("es"),
22 | new CultureInfo("no"),
23 | new CultureInfo("nb"),
24 | new CultureInfo("zh"),
25 | new CultureInfo("zh-Hant"),
26 | new CultureInfo("zh-TW"),
27 | new CultureInfo("pl"),
28 | }.ToImmutableList();
29 |
30 | public CultureInfo this[int index] => ((IReadOnlyList)_supportedCultures)[index];
31 |
32 | public int Count => ((IReadOnlyCollection)_supportedCultures).Count;
33 |
34 | public IEnumerator GetEnumerator()
35 | {
36 | return ((IEnumerable)_supportedCultures).GetEnumerator();
37 | }
38 |
39 | IEnumerator IEnumerable.GetEnumerator()
40 | {
41 | return ((IEnumerable)_supportedCultures).GetEnumerator();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.FunctionalTests/ForEvolve.AspNetCore.Localization.FunctionalTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | ForEvolve.AspNetCore.Localization
4 |
5 |
6 |
7 | netcoreapp2.1;netcoreapp3.1;net5.0
8 | false
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | all
17 | runtime; build; native; contentfiles; analyzers
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.FunctionalTests/RazorPagesLocalizationTest.cs:
--------------------------------------------------------------------------------
1 | using AngleSharp;
2 | using AngleSharp.Dom;
3 | using AngleSharp.Html.Dom;
4 | using AngleSharp.Html.Parser;
5 | using Microsoft.AspNetCore.Mvc;
6 | using Microsoft.AspNetCore.Mvc.RazorPages;
7 | using Microsoft.AspNetCore.Mvc.Testing;
8 | using Microsoft.AspNetCore.TestHost;
9 | using Microsoft.Extensions.DependencyInjection;
10 | using Newtonsoft.Json;
11 | using System;
12 | using System.Collections.Generic;
13 | using System.IO;
14 | using System.Linq;
15 | using System.Net.Http;
16 | using System.Threading.Tasks;
17 | using WebPagesSample;
18 | using WebPagesSample.Pages;
19 | using Xunit;
20 |
21 | namespace ForEvolve.AspNetCore.Localization
22 | {
23 | public class RazorPagesLocalizationTest : IClassFixture>
24 | {
25 | private readonly WebApplicationFactory _factory;
26 | public RazorPagesLocalizationTest(WebApplicationFactory factory)
27 | {
28 | if (factory == null) { throw new ArgumentNullException(nameof(factory)); }
29 |
30 | // We don't need Antiforgery for tests
31 | _factory = factory.WithWebHostBuilder(b => b.ConfigureTestServices(services => services
32 | .PostConfigure(options => options.Conventions
33 | .ConfigureFilter(new IgnoreAntiforgeryTokenAttribute()))
34 | ));
35 | }
36 |
37 |
38 | [Theory]
39 | [InlineData("fr")]
40 | public async Task When_the_form_is_submitted_messages_should_be_translated(string culture)
41 | {
42 | // Arrange
43 | var uri = $"/?culture={culture}";
44 | var parser = new HtmlParser();
45 | var client = _factory.CreateClient();
46 | var config = Configuration.Default.WithDefaultLoader();
47 |
48 | var model = new IndexModel.ValidationModel();
49 | var jsonModel = JsonConvert.SerializeObject(model);
50 | var dictionary = JsonConvert.DeserializeObject>(jsonModel);
51 |
52 | var formContent = new FormUrlEncodedContent(dictionary.Select(kv
53 | => new KeyValuePair($"Model.{kv.Key}", kv.Value)));
54 |
55 | // Post the "form"
56 | var response = await client.PostAsync(uri, formContent);
57 |
58 | // Parse the response
59 | var pageContent = await response.Content.ReadAsStringAsync();
60 | var document = await parser.ParseDocumentAsync(pageContent);
61 | var summary = document.GetElementById("validationSummary");
62 |
63 | // Find the summary messages
64 | var listItems = summary.GetElementsByTagName("li");
65 | var errorMessages = listItems.Select(x => x.TextContent);
66 |
67 | // Assert
68 | AssertMessages(culture, errorMessages);
69 | }
70 |
71 | private void AssertMessages(string culture, IEnumerable errorMessages)
72 | {
73 | switch (culture)
74 | {
75 | case "fr":
76 | AssertFrenchMessages(errorMessages);
77 | break;
78 | default:
79 | throw new NotSupportedException();
80 | }
81 | }
82 |
83 | private void AssertFrenchMessages(IEnumerable errorMessages)
84 | {
85 | Assert.Collection(errorMessages,
86 | message => Assert.Equal("Les champs 'Compare1' et 'Compare2' ne sont pas identiques.", message),
87 | message => Assert.Equal("Le champ CreditCard est un numéro de carte de crédit invalide.", message),
88 | message => Assert.Equal("Le champ EmailAddress est une adresse courriel invalide.", message),
89 | message => Assert.Equal("Le champ FileExtensions accepte uniquement les fichiers aux extensions suivantes: .png, .jpg, .jpeg, .gif", message),
90 | message => Assert.Equal("Le champ MaxLength doit avoir une longueur maximum de '5'.", message),
91 | message => Assert.Equal("Le champ MinLength doit avoir une longueur minimum de '5'.", message),
92 | message => Assert.Equal("Le champ Phone est un numéro de téléphone invalide.", message),
93 | message => Assert.Equal("Le champ Range doit être entre 10 et 20.", message),
94 | message => Assert.Equal("Le champ RegularExpression doit correspondre à l'expression régulière '[a-z]'.", message),
95 | message => Assert.Equal("Le champ Required est requis.", message),
96 | message => Assert.Equal("Le champ StringLength doit être composé d'un maximum de 5 caractères.", message),
97 | message => Assert.Equal("Le champ StringLengthIncludingMinimum doit être entre 3 et 5 caractères.", message),
98 | message => Assert.Equal("Le champ Website n'est pas une URL pleinement qualifiée valide, commençant par HTTP, HTTP ou FTP.", message)
99 | );
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.Tests/Adapters/BaseLocalizationValidationAttributeAdapterTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Xunit;
8 |
9 | namespace ForEvolve.AspNetCore.Localization.Adapters
10 | {
11 | public class BaseLocalizationValidationAttributeAdapterTest
12 | {
13 | private TestLocalizationValidationAttributeAdapter AdapterUnderTest { get; }
14 |
15 | public BaseLocalizationValidationAttributeAdapterTest()
16 | {
17 | AdapterUnderTest = new TestLocalizationValidationAttributeAdapter();
18 | }
19 |
20 | public class CanHandle : BaseLocalizationValidationAttributeAdapterTest
21 | {
22 | [Fact]
23 | public void Should_return_true_when_attribute_is_of_type_TValidationAttribute()
24 | {
25 | // Arrange
26 | var attribute = new TestValidationAttribute();
27 |
28 | // Act
29 | var result = AdapterUnderTest.CanHandle(attribute);
30 |
31 | // Assert
32 | Assert.True(result);
33 | }
34 |
35 | [Fact]
36 | public void Should_return_false_when_attribute_is_not_of_type_TValidationAttribute()
37 | {
38 | // Arrange
39 | var attribute = new AnotherTestValidationAttribute();
40 |
41 | // Act
42 | var result = AdapterUnderTest.CanHandle(attribute);
43 |
44 | // Assert
45 | Assert.False(result);
46 | }
47 | }
48 | public class GetErrorMessageResourceName : BaseLocalizationValidationAttributeAdapterTest
49 | {
50 | [Fact]
51 | public void Should_call_InternalGetErrorMessageResourceName_of_sub_class()
52 | {
53 | // Arrange
54 | var attribute = new TestValidationAttribute();
55 | var expectedAttribute = attribute;
56 | var expectedErrorMessageResourceName = AdapterUnderTest.ErrorMessageResourceName;
57 |
58 | // Act
59 | var result = AdapterUnderTest.GetErrorMessageResourceName(attribute);
60 |
61 | // Assert
62 | Assert.True(AdapterUnderTest.WasCalledOnce());
63 | Assert.Same(expectedAttribute, AdapterUnderTest.CallResults.First());
64 | Assert.Equal(expectedErrorMessageResourceName, result);
65 | }
66 | }
67 |
68 | private class TestValidationAttribute : ValidationAttribute
69 | {
70 |
71 | }
72 |
73 | private class AnotherTestValidationAttribute : ValidationAttribute
74 | {
75 |
76 | }
77 |
78 | private class TestLocalizationValidationAttributeAdapter : BaseLocalizationValidationAttributeAdapter
79 | {
80 | public const string DefaultErrorMessageResourceName = "TestLocalizationValidationAttributeAdapter-ErrorMessageResourceName";
81 |
82 | public string ErrorMessageResourceName => DefaultErrorMessageResourceName;
83 |
84 | public int CallCount => CallResults.Count;
85 |
86 | public bool WasCalled()
87 | {
88 | return CallCount > 0;
89 | }
90 |
91 | public bool WasCalledOnce()
92 | {
93 | return CallCount == 1;
94 | }
95 |
96 | public List CallResults { get; }
97 |
98 | public TestLocalizationValidationAttributeAdapter()
99 | {
100 | CallResults = new List();
101 | }
102 |
103 | protected override string InternalGetErrorMessageResourceName(TestValidationAttribute attr)
104 | {
105 | CallResults.Add(attr);
106 | return DefaultErrorMessageResourceName;
107 | }
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.Tests/Adapters/DefaultLocalizationValidationAttributeAdapterTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Text;
6 | using Xunit;
7 |
8 | namespace ForEvolve.AspNetCore.Localization.Adapters
9 | {
10 | public class DefaultLocalizationValidationAttributeAdapterTest
11 | {
12 | private DefaultLocalizationValidationAttributeAdapter AdapterUnderTest { get; }
13 |
14 | public DefaultLocalizationValidationAttributeAdapterTest()
15 | {
16 | AdapterUnderTest = new DefaultLocalizationValidationAttributeAdapter();
17 | }
18 |
19 | public class CanHandle : DefaultLocalizationValidationAttributeAdapterTest
20 | {
21 | [Fact]
22 | public void Should_return_true_when_Type_is_supported()
23 | {
24 | // Arrange
25 | var requiredAttribute = new RequiredAttribute();
26 |
27 | // Act
28 | var result = AdapterUnderTest.CanHandle(requiredAttribute);
29 |
30 | // Assert
31 | Assert.True(result);
32 | }
33 |
34 | [Fact]
35 | public void Should_return_false_when_Type_is_not_supported()
36 | {
37 | // Arrange
38 | var someValidationAttribute = new UnsupportedValidationAttribute();
39 |
40 | // Act
41 | var result = AdapterUnderTest.CanHandle(someValidationAttribute);
42 |
43 | // Assert
44 | Assert.False(result);
45 | }
46 | }
47 |
48 | public class GetErrorMessageResourceName : DefaultLocalizationValidationAttributeAdapterTest
49 | {
50 | [Fact]
51 | public void Should_return_TypeName_suffixed_by_ErrorMessage()
52 | {
53 | // Arrange
54 | var someValidationAttribute = new UnsupportedValidationAttribute();
55 | var expectedResourceName = "UnsupportedValidationAttribute_ErrorMessage";
56 |
57 | // Act
58 | var result = AdapterUnderTest.GetErrorMessageResourceName(someValidationAttribute);
59 |
60 | // Assert
61 | Assert.Equal(expectedResourceName, result);
62 | }
63 | }
64 |
65 | private class UnsupportedValidationAttribute : ValidationAttribute { }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.Tests/Adapters/StringLengthLocalizationValidationAttributeAdapterTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Text;
5 | using Xunit;
6 |
7 | namespace ForEvolve.AspNetCore.Localization.Adapters
8 | {
9 | public class StringLengthLocalizationValidationAttributeAdapterTest
10 | {
11 | private StringLengthLocalizationValidationAttributeAdapter AdapterUnderTest = new StringLengthLocalizationValidationAttributeAdapter();
12 |
13 | public class InternalGetErrorMessageResourceName : StringLengthLocalizationValidationAttributeAdapterTest
14 | {
15 | [Fact]
16 | public void Should_return_DefaultResourceName()
17 | {
18 | // Arrange
19 | var expectedResourceName = StringLengthLocalizationValidationAttributeAdapter.DefaultResourceName;
20 | var attribute = new StringLengthAttribute(50);
21 |
22 | // Act
23 | var result = AdapterUnderTest.GetErrorMessageResourceName(attribute);
24 |
25 | // Assert
26 | Assert.Equal(expectedResourceName, result);
27 | }
28 |
29 | [Fact]
30 | public void Should_return_ResourceNameIncludingMinimum_when_MinimumLength_is_greater_than_zero()
31 | {
32 | // Arrange
33 | var expectedResourceName = StringLengthLocalizationValidationAttributeAdapter.ResourceNameIncludingMinimum;
34 | var attribute = new StringLengthAttribute(50)
35 | {
36 | MinimumLength = 1
37 | };
38 |
39 | // Act
40 | var result = AdapterUnderTest.GetErrorMessageResourceName(attribute);
41 |
42 | // Assert
43 | Assert.Equal(expectedResourceName, result);
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.Tests/ForEvolve.AspNetCore.Localization.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1;netcoreapp3.1;net5.0
5 | false
6 | ForEvolve.AspNetCore.Localization
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | DataAnnotationTestResource.resx
23 | True
24 | True
25 |
26 |
27 |
28 |
29 |
30 | DataAnnotationTestResource.Designer.cs
31 | ResXFileCodeGenerator
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.Tests/ForEvolveLocalizationStartupExtensionsTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Xunit;
7 |
8 | namespace ForEvolve.AspNetCore.Localization
9 | {
10 | public class ForEvolveLocalizationStartupExtensionsTest
11 | {
12 | [Fact(Skip = "Should Test StartupExtensions")]
13 | public void TODO()
14 | {
15 | // Arrange
16 |
17 |
18 | // Act
19 |
20 |
21 | // Assert
22 | throw new NotImplementedException();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.Tests/Resources/DataAnnotationTestResource.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ForEvolve.AspNetCore.Localization.Resources {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class DataAnnotationTestResource {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal DataAnnotationTestResource() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ForEvolve.AspNetCore.Localization.Resources.DataAnnotationTestResource", typeof(DataAnnotationTestResource).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to '{0}' and '{1}' do not match..
65 | ///
66 | internal static string CompareAttribute_ErrorMessage {
67 | get {
68 | return ResourceManager.GetString("CompareAttribute_ErrorMessage", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to The {0} field is not a valid credit card number..
74 | ///
75 | internal static string CreditCardAttribute_ErrorMessage {
76 | get {
77 | return ResourceManager.GetString("CreditCardAttribute_ErrorMessage", resourceCulture);
78 | }
79 | }
80 |
81 | ///
82 | /// Looks up a localized string similar to The {0} field is not a valid e-mail address..
83 | ///
84 | internal static string EmailAddressAttribute_ErrorMessage {
85 | get {
86 | return ResourceManager.GetString("EmailAddressAttribute_ErrorMessage", resourceCulture);
87 | }
88 | }
89 |
90 | ///
91 | /// Looks up a localized string similar to The {0} field only accepts files with the following extensions: {1}.
92 | ///
93 | internal static string FileExtensionsAttribute_ErrorMessage {
94 | get {
95 | return ResourceManager.GetString("FileExtensionsAttribute_ErrorMessage", resourceCulture);
96 | }
97 | }
98 |
99 | ///
100 | /// Looks up a localized string similar to The field {0} must be a string or array type with a maximum length of '{1}'..
101 | ///
102 | internal static string MaxLengthAttribute_ErrorMessage {
103 | get {
104 | return ResourceManager.GetString("MaxLengthAttribute_ErrorMessage", resourceCulture);
105 | }
106 | }
107 |
108 | ///
109 | /// Looks up a localized string similar to The field {0} must be a string or array type with a minimum length of '{1}'..
110 | ///
111 | internal static string MinLengthAttribute_ErrorMessage {
112 | get {
113 | return ResourceManager.GetString("MinLengthAttribute_ErrorMessage", resourceCulture);
114 | }
115 | }
116 |
117 | ///
118 | /// Looks up a localized string similar to The {0} field is not a valid phone number..
119 | ///
120 | internal static string PhoneAttribute_ErrorMessage {
121 | get {
122 | return ResourceManager.GetString("PhoneAttribute_ErrorMessage", resourceCulture);
123 | }
124 | }
125 |
126 | ///
127 | /// Looks up a localized string similar to The field {0} must be between {1} and {2}..
128 | ///
129 | internal static string RangeAttribute_ErrorMessage {
130 | get {
131 | return ResourceManager.GetString("RangeAttribute_ErrorMessage", resourceCulture);
132 | }
133 | }
134 |
135 | ///
136 | /// Looks up a localized string similar to The field {0} must match the regular expression '{1}'..
137 | ///
138 | internal static string RegularExpressionAttribute_ErrorMessage {
139 | get {
140 | return ResourceManager.GetString("RegularExpressionAttribute_ErrorMessage", resourceCulture);
141 | }
142 | }
143 |
144 | ///
145 | /// Looks up a localized string similar to The {0} field is required..
146 | ///
147 | internal static string RequiredAttribute_ErrorMessage {
148 | get {
149 | return ResourceManager.GetString("RequiredAttribute_ErrorMessage", resourceCulture);
150 | }
151 | }
152 |
153 | ///
154 | /// Looks up a localized string similar to The {0} must be at maximum {1} characters long..
155 | ///
156 | internal static string StringLengthAttribute_ErrorMessage {
157 | get {
158 | return ResourceManager.GetString("StringLengthAttribute_ErrorMessage", resourceCulture);
159 | }
160 | }
161 |
162 | ///
163 | /// Looks up a localized string similar to The {0} must be at least {2} and at maximum {1} characters long..
164 | ///
165 | internal static string StringLengthAttribute_ErrorMessageIncludingMinimum {
166 | get {
167 | return ResourceManager.GetString("StringLengthAttribute_ErrorMessageIncludingMinimum", resourceCulture);
168 | }
169 | }
170 |
171 | ///
172 | /// Looks up a localized string similar to The {0} field is not a valid fully-qualified http, https, or ftp URL..
173 | ///
174 | internal static string UrlAttribute_ErrorMessage {
175 | get {
176 | return ResourceManager.GetString("UrlAttribute_ErrorMessage", resourceCulture);
177 | }
178 | }
179 | }
180 | }
181 |
--------------------------------------------------------------------------------
/test/ForEvolve.AspNetCore.Localization.Tests/Resources/DataAnnotationTestResource.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | '{0}' and '{1}' do not match.
122 |
123 |
124 | The {0} field is not a valid credit card number.
125 |
126 |
127 | The {0} field is not a valid e-mail address.
128 |
129 |
130 | The {0} field only accepts files with the following extensions: {1}
131 |
132 |
133 | The field {0} must be a string or array type with a maximum length of '{1}'.
134 |
135 |
136 | The field {0} must be a string or array type with a minimum length of '{1}'.
137 |
138 |
139 | The {0} field is not a valid phone number.
140 |
141 |
142 | The field {0} must be between {1} and {2}.
143 |
144 |
145 | The field {0} must match the regular expression '{1}'.
146 |
147 |
148 | The {0} field is required.
149 |
150 |
151 | The {0} must be at maximum {1} characters long.
152 |
153 |
154 | The {0} must be at least {2} and at maximum {1} characters long.
155 |
156 |
157 | The {0} field is not a valid fully-qualified http, https, or ftp URL.
158 |
159 |
--------------------------------------------------------------------------------
/version.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3 | "version": "3.0-alpha",
4 | "publicReleaseRefSpec": ["^refs/heads/master$", "^refs/heads/release/v\\d+\\.\\d+$"],
5 | "cloudBuild": {
6 | "setVersionVariables": true,
7 | "buildNumber": {
8 | "enabled": true
9 | }
10 | },
11 | "release": {
12 | "branchName": "release/v{version}"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------