├── Gu.Localization ├── PublicAPI.Unshipped.txt ├── .editorconfig ├── Internals │ ├── StringExt.cs │ ├── CachedEventArgs.cs │ ├── ReadOnlySet.cs │ ├── ErrorHandlingExt.cs │ ├── Ensure │ │ └── Ensure.string.cs │ ├── EnumerableExt.cs │ ├── ReadOnlySet{T}.cs │ └── ResourceManagerComparer.cs ├── CultureChangedEventArgs.cs ├── ErrorHandling.cs ├── Errors │ ├── TranslationError.cs │ ├── FormatError.cs │ └── MissingTranslation.cs ├── Gu.Localization.csproj.DotSettings ├── EnumTranslation.cs ├── MissingTranslationEventArgs.cs ├── ITranslation.cs ├── EnumTranslation{T}.cs └── Translation.ResourceManagerAndKey.cs ├── Gu.Wpf.Localization ├── PublicAPI.Unshipped.txt ├── Flags │ ├── ad.png │ ├── ae.png │ ├── af.png │ ├── ag.png │ ├── ai.png │ ├── al.png │ ├── am.png │ ├── ao.png │ ├── aq.png │ ├── ar.png │ ├── as.png │ ├── at.png │ ├── au.png │ ├── aw.png │ ├── ax.png │ ├── az.png │ ├── ba.png │ ├── bb.png │ ├── bd.png │ ├── be.png │ ├── bf.png │ ├── bg.png │ ├── bh.png │ ├── bi.png │ ├── bj.png │ ├── bl.png │ ├── bm.png │ ├── bn.png │ ├── bo.png │ ├── bq.png │ ├── br.png │ ├── bs.png │ ├── bt.png │ ├── bv.png │ ├── bw.png │ ├── by.png │ ├── bz.png │ ├── ca.png │ ├── cc.png │ ├── cd.png │ ├── cf.png │ ├── cg.png │ ├── ch.png │ ├── ci.png │ ├── ck.png │ ├── cl.png │ ├── cm.png │ ├── cn.png │ ├── co.png │ ├── cr.png │ ├── cu.png │ ├── cv.png │ ├── cw.png │ ├── cx.png │ ├── cy.png │ ├── cz.png │ ├── de.png │ ├── dj.png │ ├── dk.png │ ├── dm.png │ ├── do.png │ ├── dz.png │ ├── ec.png │ ├── ee.png │ ├── eg.png │ ├── eh.png │ ├── en.png │ ├── er.png │ ├── es.png │ ├── et.png │ ├── eu.png │ ├── fi.png │ ├── fj.png │ ├── fk.png │ ├── fm.png │ ├── fo.png │ ├── fr.png │ ├── ga.png │ ├── gb.png │ ├── gd.png │ ├── ge.png │ ├── gf.png │ ├── gg.png │ ├── gh.png │ ├── gi.png │ ├── gl.png │ ├── gm.png │ ├── gn.png │ ├── gp.png │ ├── gq.png │ ├── gr.png │ ├── gs.png │ ├── gt.png │ ├── gu.png │ ├── gw.png │ ├── gy.png │ ├── hk.png │ ├── hm.png │ ├── hn.png │ ├── hr.png │ ├── ht.png │ ├── hu.png │ ├── id.png │ ├── ie.png │ ├── il.png │ ├── im.png │ ├── in.png │ ├── io.png │ ├── iq.png │ ├── ir.png │ ├── is.png │ ├── it.png │ ├── je.png │ ├── jm.png │ ├── jo.png │ ├── jp.png │ ├── ke.png │ ├── kg.png │ ├── kh.png │ ├── ki.png │ ├── km.png │ ├── kn.png │ ├── kp.png │ ├── kr.png │ ├── kw.png │ ├── ky.png │ ├── kz.png │ ├── la.png │ ├── lb.png │ ├── lc.png │ ├── li.png │ ├── lk.png │ ├── lr.png │ ├── ls.png │ ├── lt.png │ ├── lu.png │ ├── lv.png │ ├── ly.png │ ├── ma.png │ ├── mc.png │ ├── md.png │ ├── me.png │ ├── mf.png │ ├── mg.png │ ├── mh.png │ ├── mk.png │ ├── ml.png │ ├── mm.png │ ├── mn.png │ ├── mo.png │ ├── mp.png │ ├── mq.png │ ├── mr.png │ ├── ms.png │ ├── mt.png │ ├── mu.png │ ├── mv.png │ ├── mw.png │ ├── mx.png │ ├── my.png │ ├── mz.png │ ├── na.png │ ├── nc.png │ ├── ne.png │ ├── nf.png │ ├── ng.png │ ├── ni.png │ ├── nl.png │ ├── no.png │ ├── np.png │ ├── nr.png │ ├── nu.png │ ├── nz.png │ ├── om.png │ ├── pa.png │ ├── pe.png │ ├── pf.png │ ├── pg.png │ ├── ph.png │ ├── pk.png │ ├── pl.png │ ├── pm.png │ ├── pn.png │ ├── pr.png │ ├── ps.png │ ├── pt.png │ ├── pw.png │ ├── py.png │ ├── qa.png │ ├── re.png │ ├── ro.png │ ├── rs.png │ ├── ru.png │ ├── rw.png │ ├── sa.png │ ├── sb.png │ ├── sc.png │ ├── sd.png │ ├── se.png │ ├── sg.png │ ├── sh.png │ ├── si.png │ ├── sj.png │ ├── sk.png │ ├── sl.png │ ├── sm.png │ ├── sn.png │ ├── so.png │ ├── sr.png │ ├── ss.png │ ├── st.png │ ├── sv.png │ ├── sx.png │ ├── sy.png │ ├── sz.png │ ├── tc.png │ ├── td.png │ ├── tf.png │ ├── tg.png │ ├── th.png │ ├── tj.png │ ├── tk.png │ ├── tl.png │ ├── tm.png │ ├── tn.png │ ├── to.png │ ├── tr.png │ ├── tt.png │ ├── tv.png │ ├── tw.png │ ├── tz.png │ ├── ua.png │ ├── ug.png │ ├── um.png │ ├── un.png │ ├── us.png │ ├── uy.png │ ├── uz.png │ ├── va.png │ ├── vc.png │ ├── ve.png │ ├── vg.png │ ├── vi.png │ ├── vn.png │ ├── vu.png │ ├── wf.png │ ├── ws.png │ ├── ye.png │ ├── yt.png │ ├── za.png │ ├── zm.png │ ├── zw.png │ ├── es-ct.png │ ├── gb-eng.png │ ├── gb-nir.png │ ├── gb-sct.png │ ├── gb-wls.png │ └── Readme.txt ├── .editorconfig ├── Internals │ ├── Is.cs │ ├── ServiceProviderExt.cs │ └── QualifiedNameAndKey.cs ├── Properties │ └── AssemblyInfo.cs ├── LanguageSelector │ ├── NullImageSourceConverter.cs │ └── CultureOrDefaultConverter.cs ├── Gu.Wpf.Localization.csproj.DotSettings └── MarkupExtensions │ └── CurrentCultureExtension.cs ├── Gu.Localization.snk ├── Gu.Localization.Analyzers ├── AssemblyAttributes.cs ├── AnalyzerCategory.cs ├── .editorconfig ├── Helpers │ ├── KnownSymbols │ │ ├── StringType.cs │ │ ├── TranslatorType.cs │ │ ├── TranslationType.cs │ │ ├── ResourceManagerType.cs │ │ └── KnownSymbol.cs │ ├── SemanticModelExt.cs │ └── ProjectExt.cs ├── InternalsVisibleTo.cs ├── Gu.Localization.Analyzers.csproj.DotSettings └── tools │ ├── install.ps1 │ └── uninstall.ps1 ├── Gu.Localization.Benchmarks ├── AssemblyAttributes.cs ├── .editorconfig ├── CultureBenchmark.md ├── Gu.Localization.Benchmarks.csproj └── Program.cs ├── Gu.Localization.TestStub ├── AssemblyAttributes.cs ├── App.xaml.cs ├── App.xaml ├── UserControl1.xaml.cs ├── Foo.cs ├── MainWindow.xaml.cs ├── Resources │ └── Dictionary1.xaml ├── Gu.Localization.TestStub.csproj ├── .editorconfig ├── MainWindow.xaml ├── UserControl1.xaml └── Properties │ └── Translate.cs ├── Gu.Wpf.Localization.Tests ├── AssemblyAttributes.cs ├── SharedDp.cs ├── .editorconfig ├── QualifiedNameAndKeyTests.cs ├── StaticExtensionTests.cs ├── LanguageSelector │ └── CultureToFlagPathConverterTests.cs └── Gu.Wpf.Localization.Tests.csproj ├── Gu.Wpf.Localization.UiTests ├── AssemblyAttributes.cs ├── Todo.cs ├── Gu.Wpf.Localization.UiTests.csproj.DotSettings ├── TranslatesWithNeutralLanguage.cs ├── .editorconfig ├── Helpers │ └── StartInfo.cs ├── Gu.Wpf.Localization.UiTests.csproj └── TranslatesWithNeutralResourcesLanguage.cs ├── Gu.Localization.Analyzers.Tests ├── AssemblyAttributes.cs ├── TestHelpers │ ├── TextDocumentExt.cs │ ├── FileInfoExt.cs │ ├── DirectoryInfoExt.cs │ └── SolutionExt.cs ├── .editorconfig ├── ModuleInitializer.cs ├── GULOC06UseInterpolationTests │ ├── Valid.cs │ └── CodeFix.cs ├── Helpers │ └── ResourceTests.cs ├── GULOC08DuplicateNeutralTests │ └── Valid.cs └── GULOC10MissingTranslationTests │ └── Valid.cs ├── Gu.Wpf.Localization.Demo.Fody ├── AssemblyAttributes.cs ├── Properties │ └── AssemblyInfo.cs ├── App.xaml.cs ├── FodyWeavers.xml ├── .editorconfig ├── MainWindow.xaml.cs ├── App.xaml └── Gu.Wpf.Localization.Demo.Fody.csproj ├── Gu.Wpf.Localization.Modern.Demo ├── AssemblyAttributes.cs ├── App.xaml.cs ├── Properties │ └── AssemblyAttributes.cs ├── LanguageControl.xaml.cs ├── MainWindow.xaml.cs ├── .editorconfig ├── LocalUserControl.xaml.cs ├── App.xaml ├── LanguageControl.xaml ├── Gu.Wpf.Localization.Modern.Demo.csproj ├── LocalUserControl.xaml └── MainWindow.xaml ├── Gu.Wpf.Localization.NoResources ├── AssemblyAttributes.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Settings.settings │ └── Settings.Designer.cs ├── App.config ├── App.xaml.cs ├── .editorconfig ├── App.xaml ├── MainWindow.xaml.cs └── Gu.Wpf.Localization.NoResources.csproj ├── .github └── dependabot.yml ├── Gu.Wpf.Localization.WithNeutralLanguage ├── AssemblyInfo.cs ├── App.xaml.cs ├── MainWindow.xaml.cs ├── App.xaml ├── MainWindow.xaml └── Gu.Wpf.Localization.WithNeutralLanguage.csproj ├── Gu.Localization.Tests ├── AssemblyAttributes.cs ├── Errors │ └── DummyEnum.cs ├── Helpers │ ├── TestHelpers.cs │ └── TranslationSource.cs ├── Internals │ ├── StringExtTests.cs │ ├── ResourceManagersTests.cs │ └── CultureTests.cs ├── Gu.Localization.Tests.csproj.DotSettings ├── .editorconfig ├── EnumTranslationTests.cs └── Gu.Localization.Tests.csproj ├── Gu.Wpf.Localization.Demo ├── Properties │ ├── Settings.settings │ ├── AssemblyAttributes.cs │ └── Settings.Designer.cs ├── MainWindow.xaml.cs ├── DummyEnum.cs ├── Windows │ ├── LanguageComboBoxWindow.xaml.cs │ └── LanguageComboBoxWindow.xaml ├── .editorconfig ├── ErrorsView.xaml.cs ├── LocalUserControl.xaml.cs ├── LanguageSelectorView.xaml.cs ├── App.xaml.cs ├── StringToUpperConverter.cs ├── Gu.Wpf.Localization.Demo.csproj └── LanguageSelectorView.xaml ├── Gu.Localization.Analyzers.Vsix ├── Readme.txt ├── Properties │ └── launchSettings.json ├── Gu.Localization.Analyzers.Vsix.csproj └── source.extension.vsixmanifest ├── Gu.Wpf.Localization.Demo.Controls ├── Properties │ ├── Settings.settings │ ├── AssemblyAttributes.cs │ └── Settings.Designer.cs ├── DemoUserControl.xaml.cs ├── .editorconfig ├── DemoCustomControlAutomationPeer.cs ├── DemoCustomControl.cs ├── Gu.Wpf.Localization.Demo.Controls.csproj └── DemoUserControl.xaml ├── azure-pipelines.yml ├── Gu.Wpf.Localization.WithNeutralResourcesLanguage ├── Properties │ ├── Settings.settings │ ├── AssemblyAttributes.cs │ └── Settings.Designer.cs ├── MainWindow.xaml.cs ├── App.xaml ├── App.xaml.cs └── Gu.Wpf.Localization.WithNeutralResourcesLanguage.csproj ├── stylecop.json ├── appveyor.yml ├── .gitignore ├── RELEASE_NOTES.md ├── LICENSE └── Settings.XamlStyler /Gu.Localization/PublicAPI.Unshipped.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/PublicAPI.Unshipped.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Gu.Localization.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Localization.snk -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Localization.Benchmarks/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Tests/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(false)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ad.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ae.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ae.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/af.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/af.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ag.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ai.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/al.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/al.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/am.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/am.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ao.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/aq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/aq.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ar.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/as.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/at.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/at.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/au.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/au.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/aw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/aw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ax.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/az.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/az.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ba.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bb.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bd.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/be.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/be.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bh.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bi.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bj.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bl.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bo.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bq.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/br.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/br.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bs.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bt.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bv.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/by.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/by.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/bz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/bz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ca.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cc.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cd.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ch.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ci.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ck.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cl.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/co.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cv.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cx.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cy.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/cz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/cz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/de.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/dj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/dj.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/dk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/dk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/dm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/dm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/do.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/do.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/dz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/dz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ec.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ee.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/eg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/eg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/eh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/eh.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/en.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/er.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/er.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/es.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/et.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/et.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/eu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/eu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/fi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/fi.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/fj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/fj.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/fk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/fk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/fm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/fm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/fo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/fo.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/fr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/fr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ga.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gb.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gd.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ge.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gh.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gi.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gl.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gp.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gq.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gs.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gt.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gy.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/hk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/hk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/hm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/hm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/hn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/hn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/hr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/hr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ht.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ht.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/hu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/hu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/id.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ie.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/il.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/il.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/im.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/im.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/in.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/io.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/iq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/iq.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ir.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/is.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/it.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/it.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/je.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/je.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/jm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/jm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/jo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/jo.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/jp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/jp.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ke.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/kg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/kg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/kh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/kh.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ki.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/km.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/km.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/kn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/kn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/kp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/kp.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/kr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/kr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/kw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/kw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ky.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/kz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/kz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/la.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/la.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/lb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/lb.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/lc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/lc.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/li.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/li.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/lk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/lk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/lr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/lr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ls.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/lt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/lt.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/lu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/lu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/lv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/lv.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ly.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ma.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mc.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/md.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/me.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mh.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ml.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mo.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mp.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mq.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ms.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mt.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mv.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mx.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/my.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/mz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/mz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/na.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/na.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/nc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/nc.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ne.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/nf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/nf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ng.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ni.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ni.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/nl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/nl.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/no.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/np.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/np.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/nr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/nr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/nu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/nu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/nz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/nz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/om.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/om.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pa.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pe.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ph.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pl.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ps.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pt.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/pw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/pw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/py.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/py.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/qa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/qa.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/re.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/re.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ro.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/rs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/rs.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ru.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ru.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/rw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/rw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sa.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sb.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sc.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sd.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/se.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sh.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/si.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/si.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sj.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sl.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/so.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/so.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ss.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/st.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/st.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sv.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sx.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sy.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/sz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/sz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tc.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/td.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/td.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/th.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/th.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tj.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tk.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tl.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/to.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/to.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tr.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tt.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tv.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/tz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/tz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ua.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ug.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/um.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/um.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/un.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/un.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/us.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/uy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/uy.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/uz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/uz.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/va.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/va.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/vc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/vc.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ve.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/vg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/vg.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/vi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/vi.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/vn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/vn.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/vu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/vu.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/wf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/wf.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ws.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/ye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/ye.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/yt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/yt.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/za.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/za.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/zm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/zm.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/zw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/zw.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/es-ct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/es-ct.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # SA1633: File should have header 4 | dotnet_diagnostic.SA1633.severity = none 5 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gb-eng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gb-eng.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gb-nir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gb-nir.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gb-sct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gb-sct.png -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/gb-wls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuOrg/Gu.Localization/HEAD/Gu.Wpf.Localization/Flags/gb-wls.png -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: nuget 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Tests/SharedDp.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Tests 2 | { 3 | public class SharedDp 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralLanguage/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 4 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.TestStub 2 | { 3 | using System.Windows; 4 | 5 | public partial class App : Application 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo.Fody 2 | { 3 | using System.Windows; 4 | 5 | public partial class App : Application 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Modern.Demo 2 | { 3 | using System.Windows; 4 | 5 | public partial class App : Application 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/Todo.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.UiTests 2 | { 3 | public static class Todo 4 | { 5 | public const string FixThisTest = "This test should be fixed"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralLanguage/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.WithNeutralLanguage 2 | { 3 | using System.Windows; 4 | 5 | public partial class App : Application 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | 4 | [assembly: CLSCompliant(false)] 5 | [assembly: SuppressMessage("Performance", "CA1824", Justification = "Tests assume this. Don't have time to change now.")] 6 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Vsix/Readme.txt: -------------------------------------------------------------------------------- 1 | For resetting the experimental instance: 2 | %comspec% /C "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=15.0_ad6d5903 /RootSuffix=Roslyn -------------------------------------------------------------------------------- /Gu.Localization/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # SA1633: File should have header 4 | dotnet_diagnostic.SA1633.severity = none 5 | 6 | # CA1825: Avoid unnecessary zero-length array allocations. Use Array.Empty() instead. 7 | dotnet_diagnostic.CA1825.severity = none 8 | 9 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Vsix/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Visual Studio Extension": { 4 | "executablePath": "$(DevEnvDir)devenv.exe", 5 | "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | pool: 2 | vmImage: 'windows-2022' 3 | 4 | steps: 5 | 6 | - task: DotNetCoreCLI@2 7 | displayName: 'build' 8 | inputs: 9 | command: 'build' 10 | 11 | - task: DotNetCoreCLI@2 12 | displayName: 'test' 13 | inputs: 14 | command: 'test' -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/Properties/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media; 2 | 3 | // required to support per-monitor DPI awareness in Windows 8.1+ 4 | // see also https://mui.codeplex.com/wikipage?title=Per-monitor%20DPI%20awareness 5 | [assembly: DisableDpiAwareness] 6 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralResourcesLanguage/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Gu.Wpf.Localization.NoResources 4 | { 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "documentationRules": { 5 | "documentInternalElements": false 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo 2 | { 3 | using System.Windows; 4 | 5 | public partial class MainWindow : Window 6 | { 7 | public MainWindow() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2022 2 | configuration: Release 3 | platform: Any CPU 4 | 5 | before_build: 6 | ps: dotnet restore 7 | 8 | build: 9 | verbosity: minimal 10 | 11 | on_failure: 12 | ps: Get-ChildItem $env:temp\*.png | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } 13 | -------------------------------------------------------------------------------- /Gu.Localization/Internals/StringExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | internal static class StringExt 4 | { 5 | internal static string Slice(this string text, int start, int end) 6 | { 7 | return text.Substring(start, end - start + 1); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/UserControl1.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.TestStub 2 | { 3 | using System.Windows.Controls; 4 | 5 | public partial class UserControl1 : UserControl 6 | { 7 | public UserControl1() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralResourcesLanguage/Properties/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Windows; 3 | 4 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 5 | [assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.MainAssembly)] 6 | 7 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/Foo.cs: -------------------------------------------------------------------------------- 1 | // ReSharper disable UnusedMember.Global 2 | #pragma warning disable 219 3 | #pragma warning disable GULOC06 4 | namespace Gu.Localization.TestStub 5 | { 6 | public class Foo 7 | { 8 | public Foo() 9 | { 10 | var text = "One resource"; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/LanguageControl.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Modern.Demo 2 | { 3 | using System.Windows.Controls; 4 | 5 | public partial class LanguageControl : UserControl 6 | { 7 | public LanguageControl() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Modern.Demo 2 | { 3 | using FirstFloor.ModernUI.Windows.Controls; 4 | 5 | public partial class MainWindow : ModernWindow 6 | { 7 | public MainWindow() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/DemoUserControl.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo.Controls 2 | { 3 | using System.Windows.Controls; 4 | 5 | public partial class DemoUserControl : UserControl 6 | { 7 | public DemoUserControl() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralResourcesLanguage/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.WithNeutralResourcesLanguage 2 | { 3 | using System.Windows; 4 | 5 | public partial class MainWindow : Window 6 | { 7 | public MainWindow() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/DummyEnum.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo 2 | { 3 | #pragma warning disable CA1711 // Identifiers should not have incorrect suffix 4 | public enum DummyEnum 5 | #pragma warning restore CA1711 // Identifiers should not have incorrect suffix 6 | { 7 | TranslatedToAll, 8 | MemberTwo, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/Windows/LanguageComboBoxWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo.Windows 2 | { 3 | using System.Windows; 4 | 5 | public partial class LanguageComboBoxWindow : Window 6 | { 7 | public LanguageComboBoxWindow() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/AnalyzerCategory.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers 2 | { 3 | /// 4 | /// Class defining the analyzer category constants. 5 | /// 6 | internal static class AnalyzerCategory 7 | { 8 | internal const string Correctness = "Gu.Localization.Analyzers.Correctness"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | 8 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Tests/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | 8 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/TestHelpers/TextDocumentExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.Helpers 2 | { 3 | using Microsoft.CodeAnalysis; 4 | 5 | internal static class TextDocumentExt 6 | { 7 | internal static string GetText(this TextDocument file) => file.GetTextAsync().GetAwaiter().GetResult().ToString(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/Errors/DummyEnum.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Tests.Errors 2 | { 3 | #pragma warning disable CA1711 // Identifiers should not have incorrect suffix 4 | public enum DummyEnum 5 | #pragma warning restore CA1711 // Identifiers should not have incorrect suffix 6 | { 7 | AllLanguages, 8 | MissingTranslation, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | 8 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | # SA1203: Constants should appear before fields 3 | dotnet_diagnostic.SA1203.severity = none 4 | 5 | # CA1724: The type name Diagnostics conflicts in whole or in part with the namespace name 'System.Diagnostics' defined in the .NET Framework. Rename the type to eliminate the conflict. 6 | dotnet_diagnostic.CA1724.severity = none 7 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | # SA1203: Constants should appear before fields 3 | dotnet_diagnostic.SA1203.severity = none 4 | 5 | # CA1724: The type name Diagnostics conflicts in whole or in part with the namespace name 'System.Diagnostics' defined in the .NET Framework. Rename the type to eliminate the conflict. 6 | dotnet_diagnostic.CA1724.severity = none 7 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Gu.Localization.TestStub 4 | { 5 | /// 6 | /// Interaction logic for Window1.xaml 7 | /// 8 | public partial class Window1 : Window 9 | { 10 | public Window1() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/Properties/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Windows; 4 | 5 | [assembly: CLSCompliant(false)] 6 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 7 | [assembly: SuppressMessage("Performance", "CA1824", Justification = "Tests assume this. Don't have time to change now.")] 8 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/Properties/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Windows; 4 | 5 | [assembly: CLSCompliant(false)] 6 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 7 | [assembly: SuppressMessage("Performance", "CA1824", Justification = "Tests assume this. Don't have time to change now.")] 8 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Gu.Wpf.Localization.NoResources 4 | { 5 | /// 6 | /// Interaction logic for MainWindow.xaml 7 | /// 8 | public partial class MainWindow : Window 9 | { 10 | public MainWindow() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/ErrorsView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo 2 | { 3 | using System.Windows.Controls; 4 | 5 | /// 6 | /// Interaction logic for Errors.xaml. 7 | /// 8 | public partial class ErrorsView : UserControl 9 | { 10 | public ErrorsView() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/LocalUserControl.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo 2 | { 3 | using System.Windows.Controls; 4 | 5 | /// 6 | /// Interaction logic for UserControl.xaml. 7 | /// 8 | public partial class LocalUserControl : UserControl 9 | { 10 | public LocalUserControl() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/LocalUserControl.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Modern.Demo 2 | { 3 | using System.Windows.Controls; 4 | 5 | /// 6 | /// Interaction logic for UserControl.xaml 7 | /// 8 | public partial class LocalUserControl : UserControl 9 | { 10 | public LocalUserControl() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/LanguageSelectorView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo 2 | { 3 | using System.Windows.Controls; 4 | 5 | /// 6 | /// Interaction logic for LanguageSelectorView.xaml. 7 | /// 8 | public partial class LanguageSelectorView : UserControl 9 | { 10 | public LanguageSelectorView() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo.Fody 2 | { 3 | using System.Globalization; 4 | using System.Windows; 5 | using Gu.Localization; 6 | 7 | public partial class MainWindow : Window 8 | { 9 | public MainWindow() 10 | { 11 | this.InitializeComponent(); 12 | Translator.Culture = CultureInfo.GetCultureInfo("sv-SE"); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/Resources/Dictionary1.xaml: -------------------------------------------------------------------------------- 1 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | [*.cs] 4 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 5 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 6 | # SA0001: XML comment analysis is disabled due to project configuration 7 | dotnet_diagnostic.SA0001.severity = none 8 | 9 | # RS2008: Enable analyzer release tracking 10 | dotnet_diagnostic.RS2008.severity = none 11 | -------------------------------------------------------------------------------- /Gu.Localization/Internals/CachedEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System.Collections.Specialized; 4 | using System.ComponentModel; 5 | 6 | internal static class CachedEventArgs 7 | { 8 | internal static readonly PropertyChangedEventArgs CountPropertyChanged = new("Count"); 9 | internal static readonly NotifyCollectionChangedEventArgs NotifyCollectionReset = new(NotifyCollectionChangedAction.Reset); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralLanguage/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.WithNeutralLanguage 2 | { 3 | using System.Globalization; 4 | using System.Windows; 5 | using Gu.Localization; 6 | 7 | public partial class MainWindow : Window 8 | { 9 | public MainWindow() 10 | { 11 | this.InitializeComponent(); 12 | Translator.Culture = CultureInfo.GetCultureInfo("en"); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Helpers/KnownSymbols/StringType.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers 2 | { 3 | using Gu.Roslyn.AnalyzerExtensions; 4 | 5 | internal class StringType : QualifiedType 6 | { 7 | internal StringType() 8 | : base("System.String", "string") 9 | { 10 | this.Format = new QualifiedMethod(this, nameof(this.Format)); 11 | } 12 | 13 | internal QualifiedMethod Format { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/InternalsVisibleTo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly:InternalsVisibleTo("Gu.Localization.Analyzers.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001008F3FADDAC2AF5D3A713943D1661FF19562CB93322F985E0A9EE5EA8FBA5D2DE865E27EF3F90B85AE33EABE89449BA2EF391046E9E55080F4E895AA51C298A810445F8C2E00A3EDE5AD9750801E0120421F2747BEDC112D082001C10F3255E33CC7DC4D0263792B195CFCF935C5D723EB85A4906C4B9C5B9D1FC980DE1594FE98")] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #ignore thumbnails created by windows 3 | Thumbs.db 4 | #Ignore files build by Visual Studio 5 | *.obj 6 | *.exe 7 | *.pdb 8 | *.user 9 | *.aps 10 | *.pch 11 | *.vspscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.suo 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.cache 20 | *.ilk 21 | *.log 22 | [Bb]in 23 | [Dd]ebug*/ 24 | *.lib 25 | *.sbr 26 | obj/ 27 | [Rr]elease*/ 28 | _ReSharper*/ 29 | [Tt]est[Rr]esult* 30 | *.vsp 31 | *.psess 32 | packages/* 33 | publish/* 34 | .vs/* 35 | *.orig 36 | -------------------------------------------------------------------------------- /Gu.Localization/Internals/ReadOnlySet.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | internal static class ReadOnlySet 7 | { 8 | internal static ReadOnlySet Create(IEnumerable items) 9 | { 10 | if (items.Any()) 11 | { 12 | return new ReadOnlySet(items); 13 | } 14 | 15 | return ReadOnlySet.Empty; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/Gu.Wpf.Localization.UiTests.csproj.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | True -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Helpers/SemanticModelExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers 2 | { 3 | using Gu.Roslyn.AnalyzerExtensions; 4 | using Microsoft.CodeAnalysis; 5 | 6 | internal static class SemanticModelExt 7 | { 8 | internal static bool ReferencesGuLocalization(this SemanticModel semanticModel) 9 | { 10 | return semanticModel.Compilation.ReferencedAssemblyNames.TryFirst(x => x.Name == "Gu.Localization", out _); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralLanguage/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Helpers/KnownSymbols/TranslatorType.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers 2 | { 3 | using Gu.Roslyn.AnalyzerExtensions; 4 | 5 | internal class TranslatorType : QualifiedType 6 | { 7 | internal TranslatorType() 8 | : base("Gu.Localization.Translator") 9 | { 10 | this.Translate = new QualifiedMethod(this, nameof(this.Translate)); 11 | } 12 | 13 | internal QualifiedMethod Translate { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Helpers/KnownSymbols/TranslationType.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers 2 | { 3 | using Gu.Roslyn.AnalyzerExtensions; 4 | 5 | internal class TranslationType : QualifiedType 6 | { 7 | internal TranslationType() 8 | : base("Gu.Localization.Translation") 9 | { 10 | this.GetOrCreate = new QualifiedMethod(this, nameof(this.GetOrCreate)); 11 | } 12 | 13 | internal QualifiedMethod GetOrCreate { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralResourcesLanguage/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/Helpers/TestHelpers.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Tests 2 | { 3 | using System.Collections; 4 | using System.Reflection; 5 | 6 | public static class TestHelpers 7 | { 8 | public static void ClearTranslationCache() 9 | { 10 | var fieldInfo = typeof(Translation).GetField("Cache", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly); 11 | var cache = (IDictionary)fieldInfo.GetValue(null); 12 | cache.Clear(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Gu.Localization.Benchmarks/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | 8 | # CA1303: Do not pass literals as localized parameters 9 | dotnet_diagnostic.CA1303.severity = none 10 | 11 | # CA1822: Mark members as static 12 | dotnet_diagnostic.CA1822.severity = none 13 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/TranslatesWithNeutralLanguage.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.UiTests 2 | { 3 | using Gu.Wpf.UiAutomation; 4 | using NUnit.Framework; 5 | 6 | public static class TranslatesWithNeutralLanguage 7 | { 8 | [Test] 9 | public static void EffectiveCulture() 10 | { 11 | // Just a smoke test so we don't crash. 12 | using var app = Application.Launch("Gu.Wpf.Localization.WithNeutralLanguage.exe"); 13 | Assert.NotNull(app.MainWindow); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo 2 | { 3 | using System.Globalization; 4 | using System.Threading; 5 | using System.Windows; 6 | 7 | public partial class App : Application 8 | { 9 | protected override void OnStartup(StartupEventArgs e) 10 | { 11 | if (e is { Args: { Length: 1 } args }) 12 | { 13 | Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(args[0]); 14 | } 15 | 16 | base.OnStartup(e); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/Internals/StringExtTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Tests.Internals 2 | { 3 | using NUnit.Framework; 4 | 5 | public class StringExtTests 6 | { 7 | [TestCase("abcd", 0, 3, "abcd")] 8 | [TestCase("abcd", 1, 3, "bcd")] 9 | [TestCase("abcd", 0, 0, "a")] 10 | [TestCase("abcd", 3, 3, "d")] 11 | public void Slice(string text, int start, int end, string expected) 12 | { 13 | var actual = text.Slice(start, end); 14 | Assert.AreEqual(expected, actual); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 3 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 4 | # SA0001: XML comment analysis is disabled due to project configuration 5 | dotnet_diagnostic.SA0001.severity = none 6 | 7 | # CA1724: The type name Diagnostics conflicts in whole or in part with the namespace name 'System.Diagnostics' defined in the .NET Framework. Rename the type to eliminate the conflict. 8 | dotnet_diagnostic.CA1724.severity = none 9 | -------------------------------------------------------------------------------- /Gu.Localization/Internals/ErrorHandlingExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | internal static class ErrorHandlingExt 4 | { 5 | internal static ErrorHandling Coerce(this ErrorHandling errorHandling) 6 | { 7 | if (errorHandling != ErrorHandling.Inherit) 8 | { 9 | return errorHandling; 10 | } 11 | 12 | return Translator.ErrorHandling == ErrorHandling.Inherit 13 | ? ErrorHandling.ReturnErrorInfoPreserveNeutral 14 | : Translator.ErrorHandling; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralResourcesLanguage/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.WithNeutralResourcesLanguage 2 | { 3 | using System.Globalization; 4 | using System.Threading; 5 | using System.Windows; 6 | 7 | public partial class App : Application 8 | { 9 | protected override void OnStartup(StartupEventArgs e) 10 | { 11 | if (e.Args.Length == 1) 12 | { 13 | Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(e.Args[0]); 14 | } 15 | 16 | base.OnStartup(e); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/Gu.Localization.TestStub.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | WinExe 4 | net6.0-windows 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/DemoCustomControlAutomationPeer.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo.Controls 2 | { 3 | using System.Windows.Automation.Peers; 4 | 5 | public class DemoCustomControlAutomationPeer : FrameworkElementAutomationPeer 6 | { 7 | public DemoCustomControlAutomationPeer(DemoCustomControl owner) 8 | : base(owner) 9 | { 10 | } 11 | 12 | protected override string GetClassNameCore() => "DemoCustomControl"; 13 | 14 | protected override AutomationControlType GetAutomationControlTypeCore() => AutomationControlType.Custom; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/DemoCustomControl.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo.Controls 2 | { 3 | using System.Windows; 4 | using System.Windows.Automation.Peers; 5 | using System.Windows.Controls; 6 | 7 | public class DemoCustomControl : Control 8 | { 9 | static DemoCustomControl() 10 | { 11 | DefaultStyleKeyProperty.OverrideMetadata(typeof(DemoCustomControl), new FrameworkPropertyMetadata(typeof(DemoCustomControl))); 12 | } 13 | 14 | protected override AutomationPeer OnCreateAutomationPeer() => new DemoCustomControlAutomationPeer(this); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralLanguage/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/TestHelpers/FileInfoExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.Helpers 2 | { 3 | using System.IO; 4 | using Gu.Roslyn.Asserts; 5 | 6 | internal static class FileInfoExt 7 | { 8 | internal static void ReplaceText(this FileInfo file, string oldText, string newText) 9 | { 10 | File.WriteAllText(file.FullName, File.ReadAllText(file.FullName).AssertReplace(oldText, newText)); 11 | } 12 | 13 | internal static string ReadAllText(this FileInfo file) 14 | { 15 | return File.ReadAllText(file.FullName); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Helpers/KnownSymbols/ResourceManagerType.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers 2 | { 3 | using Gu.Roslyn.AnalyzerExtensions; 4 | 5 | internal class ResourceManagerType : QualifiedType 6 | { 7 | internal ResourceManagerType() 8 | : base("System.Resources.ResourceManager") 9 | { 10 | this.GetObject = new QualifiedMethod(this, nameof(this.GetObject)); 11 | this.GetString = new QualifiedMethod(this, nameof(this.GetString)); 12 | } 13 | 14 | internal QualifiedMethod GetObject { get; } 15 | 16 | internal QualifiedMethod GetString { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | 8 | # CA1303: Do not pass literals as localized parameters 9 | dotnet_diagnostic.CA1303.severity = none 10 | 11 | # IDE0079: Remove unnecessary suppression 12 | dotnet_diagnostic.IDE0079.severity = none 13 | 14 | # IDE0059: Unnecessary assignment of a value 15 | dotnet_diagnostic.IDE0059.severity = none 16 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Internals/Is.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization 2 | { 3 | using System.ComponentModel; 4 | using System.Windows; 5 | 6 | /// 7 | /// The design mode. 8 | /// 9 | internal static class Is 10 | { 11 | /// 12 | /// The dependency object. 13 | /// 14 | private static readonly DependencyObject DependencyObject = new(); 15 | 16 | /// 17 | /// Gets a value indicating whether is design mode. 18 | /// 19 | internal static bool DesignMode => DesignerProperties.GetIsInDesignMode(DependencyObject); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | # SA1203: Constants should appear before fields 8 | dotnet_diagnostic.SA1203.severity = none 9 | 10 | # CA1724: The type name Diagnostics conflicts in whole or in part with the namespace name 'System.Diagnostics' defined in the .NET Framework. Rename the type to eliminate the conflict. 11 | dotnet_diagnostic.CA1724.severity = none 12 | -------------------------------------------------------------------------------- /Gu.Localization/CultureChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System; 4 | using System.Globalization; 5 | 6 | /// Event data for culture change events. 7 | public class CultureChangedEventArgs : EventArgs 8 | { 9 | /// Initializes a new instance of the class. 10 | /// The culture. 11 | public CultureChangedEventArgs(CultureInfo culture) 12 | { 13 | this.Culture = culture; 14 | } 15 | 16 | /// Gets the culture. 17 | public CultureInfo Culture { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Gu.Localization/ErrorHandling.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | /// Specify a strategy for how translation errors are handled. 4 | public enum ErrorHandling 5 | { 6 | /// Inherits behaviour from or defaults to throw. 7 | Inherit, 8 | 9 | /// Throws if something is wrong. 10 | Throw, 11 | 12 | /// Returns information about the error in the result. 13 | ReturnErrorInfo, 14 | 15 | /// Returns information about the error in the result but leaves neutral strings intact. 16 | ReturnErrorInfoPreserveNeutral, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralResourcesLanguage/Gu.Wpf.Localization.WithNeutralResourcesLanguage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | WinExe 4 | net6.0-windows 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/Gu.Localization.Tests.csproj.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | True 6 | True -------------------------------------------------------------------------------- /Gu.Localization/Internals/Ensure/Ensure.string.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System; 4 | using System.Diagnostics; 5 | using System.Diagnostics.CodeAnalysis; 6 | 7 | [SuppressMessage("ReSharper", "UnusedParameter.Global", Justification = "All this class does are precondition checks.")] 8 | internal static partial class Ensure 9 | { 10 | internal static void NotNullOrEmpty(string value, string parameterName) 11 | { 12 | Debug.Assert(!string.IsNullOrEmpty(parameterName), $"{nameof(parameterName)} cannot be null"); 13 | if (string.IsNullOrEmpty(value)) 14 | { 15 | throw new ArgumentNullException(parameterName); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Tests/QualifiedNameAndKeyTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Tests 2 | { 3 | using NUnit.Framework; 4 | 5 | public class QualifiedNameAndKeyTests 6 | { 7 | [TestCase("p:Resources.Key")] 8 | public void Parse(string s) 9 | { 10 | var actual = QualifiedNameAndKey.Parse(s); 11 | Assert.AreEqual("p:Resources", actual.QualifiedName); 12 | Assert.AreEqual("Key", actual.Key); 13 | } 14 | 15 | [Test] 16 | public void Caches() 17 | { 18 | var actual1 = QualifiedNameAndKey.Parse("p:Resources.Key"); 19 | var actual2 = QualifiedNameAndKey.Parse("p:Resources.Key"); 20 | Assert.AreSame(actual1, actual2); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralLanguage/Gu.Wpf.Localization.WithNeutralLanguage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net6.0-windows 6 | true 7 | en 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Gu.Localization/Internals/EnumerableExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | internal static class EnumerableExt 7 | { 8 | internal static IEnumerable Prepend(this IEnumerable source, TSource element) 9 | { 10 | return PrependIterator(source ?? throw new ArgumentNullException(nameof(source)), element); 11 | 12 | static IEnumerable PrependIterator(IEnumerable source, TSource element) 13 | { 14 | yield return element; 15 | 16 | foreach (var item in source) 17 | { 18 | yield return item; 19 | } 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Gu.Localization.Benchmarks/CultureBenchmark.md: -------------------------------------------------------------------------------- 1 | ``` ini 2 | 3 | BenchmarkDotNet=v0.11.1, OS=Windows 10.0.17134.285 (1803/April2018Update/Redstone4) 4 | Intel Core i7-7500U CPU 2.70GHz (Max: 0.80GHz) (Kaby Lake), 1 CPU, 4 logical and 2 physical cores 5 | Frequency=2835934 Hz, Resolution=352.6175 ns, Timer=TSC 6 | .NET Core SDK=2.1.402 7 | [Host] : .NET Core 2.1.4 (CoreCLR 4.6.26814.03, CoreFX 4.6.26814.02), 64bit RyuJIT 8 | DefaultJob : .NET Core 2.1.4 (CoreCLR 4.6.26814.03, CoreFX 4.6.26814.02), 64bit RyuJIT 9 | 10 | 11 | ``` 12 | | Method | Mean | Error | StdDev | Gen 0 | Allocated | 13 | |------------------------------ |---------:|---------:|---------:|--------:|----------:| 14 | | CreateNeutralCultureRegionMap | 220.7 us | 3.689 us | 3.270 us | 64.4531 | 132.43 KB | 15 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/UserControl1.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/Gu.Wpf.Localization.NoResources.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | WinExe 4 | net6.0-windows 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 3 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 4 | # SA0001: XML comment analysis is disabled due to project configuration 5 | dotnet_diagnostic.SA0001.severity = none 6 | 7 | # CA1034: Nested types should not be visible 8 | dotnet_diagnostic.CA1034.severity = none 9 | # CA1062: Validate arguments of public methods 10 | dotnet_diagnostic.CA1062.severity = none 11 | # CA1304: Specify CultureInfo 12 | dotnet_diagnostic.CA1304.severity = none 13 | # CA1724: The type name Diagnostics conflicts in whole or in part with the namespace name 'System.Diagnostics' defined in the .NET Framework. Rename the type to eliminate the conflict. 14 | dotnet_diagnostic.CA1724.severity = none 15 | 16 | -------------------------------------------------------------------------------- /Gu.Localization/Errors/TranslationError.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Errors 2 | { 3 | using System.CodeDom.Compiler; 4 | 5 | /// A base class for translation error. 6 | public abstract class TranslationError 7 | { 8 | /// Initializes a new instance of the class. 9 | /// The key. 10 | protected TranslationError(string key) 11 | { 12 | this.Key = key; 13 | } 14 | 15 | /// Gets the key for which errors were found. 16 | public string Key { get; } 17 | 18 | /// Append self to . 19 | /// The writer. 20 | internal abstract void WriteTo(IndentedTextWriter writer); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Gu.Localization/Internals/ReadOnlySet{T}.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | internal sealed class ReadOnlySet : IReadOnlyCollection 7 | { 8 | internal static readonly ReadOnlySet Empty = new(new T[0]); 9 | 10 | private readonly HashSet set; 11 | 12 | internal ReadOnlySet(IEnumerable items) 13 | { 14 | this.set = new HashSet(items); 15 | } 16 | 17 | public int Count => this.set.Count; 18 | 19 | public IEnumerator GetEnumerator() => this.set.GetEnumerator(); 20 | 21 | IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); 22 | 23 | internal bool Contains(T item) 24 | { 25 | return this.set.Contains(item); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using System.Windows; 4 | using System.Windows.Markup; 5 | 6 | [assembly: CLSCompliant(false)] 7 | [assembly: InternalsVisibleTo("Gu.Wpf.Localization.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001008F3FADDAC2AF5D3A713943D1661FF19562CB93322F985E0A9EE5EA8FBA5D2DE865E27EF3F90B85AE33EABE89449BA2EF391046E9E55080F4E895AA51C298A810445F8C2E00A3EDE5AD9750801E0120421F2747BEDC112D082001C10F3255E33CC7DC4D0263792B195CFCF935C5D723EB85A4906C4B9C5B9D1FC980DE1594FE98", AllInternalsVisible = true)] 8 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 9 | [assembly: XmlnsDefinition("http://gu.se/Localization", "Gu.Wpf.Localization")] 10 | [assembly: XmlnsPrefix("http://gu.se/Localization", "l")] 11 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Flags/Readme.txt: -------------------------------------------------------------------------------- 1 | Flags from: https://github.com/lipis/flag-icon-css (Converted to png) 2 | 3 | [Test] 4 | public void DumpCultures() 5 | { 6 | var cultureInfos = CultureInfo.GetCultures(CultureTypes.InstalledWin32Cultures) 7 | .OrderBy(x => x.DisplayName) 8 | .Select(x => x.TwoLetterISOLanguageName) 9 | .Distinct() 10 | .ToArray(); 11 | foreach (var name in cultureInfos) 12 | { 13 | try 14 | { 15 | var cultureInfo = CultureInfo.GetCultureInfo(name); 16 | Console.WriteLine($"{cultureInfo.DisplayName}, {cultureInfo.TwoLetterISOLanguageName}"); 17 | } 18 | catch (Exception) 19 | { 20 | //Console.WriteLine(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Helpers/ProjectExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers 2 | { 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.CodeAnalysis; 6 | 7 | internal static class ProjectExt 8 | { 9 | internal static IEnumerable ReferencedProjects(this Project project) 10 | { 11 | return project.ProjectReferences.Select(x => project.Solution.GetProject(x.ProjectId)); 12 | } 13 | 14 | internal static IEnumerable ReferencingProjects(this Project project) 15 | { 16 | foreach (var candidate in project.Solution.Projects) 17 | { 18 | if (candidate.AllProjectReferences.Any(x => x.ProjectId == project.Id)) 19 | { 20 | yield return candidate; 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | #### 6.7.0 2 | * BUGFIX: Handle when used for setting binding source. 3 | 4 | #### 6.6.0 5 | * FEATURE: Compatible with net 5 single file. 6 | 7 | #### 6.5.0 8 | * FEATURE: Nullable enable. 9 | * FEATURE: netcoreapp3.1 10 | * FEATURE: Translator.MissingTranslation 11 | 12 | #### 6.4.3 13 | * BUGFIX: Type initialization for Culture fails if installed cultures contains invalid neutral ancestry. Issue 82. 14 | 15 | #### 6.4.2 16 | * FEATURE: Netstandard support. 17 | 18 | #### 6.4.1 19 | * BUGFIX: CultureOrDefaultConverter handle twoway bindings. 20 | 21 | #### 6.4.0 22 | * FEATURE: Fody support. 23 | 24 | #### 6.2.0 25 | * FEATURE: More flags. 26 | * FEATURE: LanguageSelector.ItemTemplate 27 | * MINOR BREAKING: Tweaked default style for LanguageSelector. 28 | * MINOR BREAKING: Renamed some flags, they have region names now. 29 | 30 | #### 6.2.0 31 | * BUGFIX: Exclude SourceLink dependency in packages. 32 | 33 | #### 6.2.1 34 | * FEATURE: sign 35 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/ModuleInitializer.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | using Gu.Roslyn.Asserts; 6 | using Microsoft.CodeAnalysis; 7 | 8 | internal static class ModuleInitializer 9 | { 10 | [ModuleInitializer] 11 | internal static void Initialize() 12 | { 13 | Settings.Default = Settings.Default 14 | .WithCompilationOptions(x => x.WithSuppressedDiagnostics("CS1701", "CS8019") 15 | .WithNullableContextOptions(NullableContextOptions.Disable)) 16 | .WithMetadataReferences(MetadataReferences.Transitive( 17 | typeof(Gu.Localization.Translation), 18 | typeof(System.Windows.Window))); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/TestHelpers/DirectoryInfoExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.Helpers 2 | { 3 | using System.IO; 4 | using NUnit.Framework; 5 | 6 | internal static class DirectoryInfoExt 7 | { 8 | internal static void CopyTo(this DirectoryInfo source, DirectoryInfo target) 9 | { 10 | foreach (var dir in source.GetDirectories()) 11 | { 12 | CopyTo(dir, target.CreateSubdirectory(dir.Name)); 13 | } 14 | 15 | foreach (var file in source.GetFiles()) 16 | { 17 | file.CopyTo(Path.Combine(target.FullName, file.Name)); 18 | } 19 | } 20 | 21 | internal static FileInfo FindFile(this DirectoryInfo directory, string name) 22 | { 23 | var fileInfo = new FileInfo(Path.Combine(directory.FullName, name)); 24 | Assert.True(fileInfo.Exists); 25 | return fileInfo; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/LanguageControl.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Gu.Localization/Gu.Localization.csproj.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | True 5 | True 6 | True -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Fody/Gu.Wpf.Localization.Demo.Fody.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | WinExe 4 | net6.0-windows 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Tests/StaticExtensionTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Tests 2 | { 3 | using System; 4 | using System.Windows.Markup; 5 | using Moq; 6 | using NUnit.Framework; 7 | 8 | public class StaticExtensionTests 9 | { 10 | [Test] 11 | public void ProvideValueSharedDp() 12 | { 13 | var serviceProviderMock = new Mock(MockBehavior.Strict); 14 | var provideValueTargetMock = new Mock(MockBehavior.Strict); 15 | provideValueTargetMock.SetupGet(x => x.TargetObject).Returns(new SharedDp()); 16 | serviceProviderMock.Setup(x => x.GetService(typeof(IProvideValueTarget))) 17 | .Returns(provideValueTargetMock.Object); 18 | var translateExtension = new Localization.StaticExtension("meh"); 19 | var actual = translateExtension.ProvideValue(serviceProviderMock.Object); 20 | Assert.AreEqual("#meh#", actual); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Gu.Localization/EnumTranslation.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System.Resources; 4 | 5 | /// Helper for creating enum translations. 6 | public static class EnumTranslation 7 | { 8 | /// Create a translation for . 9 | /// An enum type. 10 | /// The with translations for . 11 | /// The member to translate. 12 | /// Specifies how errors are handled. 13 | /// A . 14 | public static ITranslation Create(ResourceManager resourceManager, T member, ErrorHandling errorHandling = ErrorHandling.Inherit) 15 | where T : System.Enum 16 | { 17 | return Translation.GetOrCreate(resourceManager, member.ToString(), errorHandling); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/LanguageSelector/NullImageSourceConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization 2 | { 3 | using System; 4 | using System.Globalization; 5 | using System.Windows.Data; 6 | using System.Windows.Media; 7 | 8 | /// 9 | [ValueConversion(typeof(ImageSource), typeof(object))] 10 | public sealed class NullImageSourceConverter : IValueConverter 11 | { 12 | /// The default instance. 13 | public static readonly NullImageSourceConverter Default = new(); 14 | 15 | /// 16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | return value ?? Binding.DoNothing; 19 | } 20 | 21 | /// 22 | object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 23 | { 24 | throw new NotSupportedException($"{nameof(NullImageSourceConverter)} can only be used with {nameof(BindingMode)}.{nameof(BindingMode.OneWay)}"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/GULOC06UseInterpolationTests/Valid.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.GULOC06UseInterpolationTests 2 | { 3 | using Gu.Roslyn.Asserts; 4 | using NUnit.Framework; 5 | 6 | public static class Valid 7 | { 8 | private static readonly LiteralAnalyzer Analyzer = new(); 9 | 10 | [Test] 11 | public static void NoCuriles() 12 | { 13 | var code = @" 14 | namespace RoslynSandbox 15 | { 16 | public class Foo 17 | { 18 | public Foo() 19 | { 20 | #pragma warning disable GULOC03, CS0219 21 | var translate = ""abc""; 22 | } 23 | } 24 | }"; 25 | RoslynAssert.Valid(Analyzer, code); 26 | } 27 | 28 | [Test] 29 | public static void Interpolated() 30 | { 31 | var code = @" 32 | namespace RoslynSandbox 33 | { 34 | public class Foo 35 | { 36 | public Foo() 37 | { 38 | var translate = $""abc {1}""; 39 | } 40 | } 41 | }"; 42 | RoslynAssert.Valid(Analyzer, code); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/StringToUpperConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Demo 2 | { 3 | using System; 4 | using System.Windows.Data; 5 | 6 | [ValueConversion(typeof(string), typeof(string))] 7 | public sealed class StringToUpperConverter : IValueConverter 8 | { 9 | public static readonly StringToUpperConverter Default = new(); 10 | 11 | public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture) 12 | { 13 | return value switch 14 | { 15 | string { } s => s.ToUpper(culture), 16 | null => null, 17 | _ => throw new ArgumentException($"Expected a string, was: {value.GetType()} with value: {value}"), 18 | }; 19 | } 20 | 21 | object IValueConverter.ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture) 22 | { 23 | throw new System.NotSupportedException($"{nameof(StringToUpperConverter)} can only be used in OneWay bindings"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/EnumTranslationTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Tests 2 | { 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Globalization; 6 | using System.Linq; 7 | 8 | using Gu.Localization.Tests.Errors; 9 | 10 | using NUnit.Framework; 11 | 12 | public class EnumTranslationTests 13 | { 14 | [Test] 15 | public void Create() 16 | { 17 | var translation = EnumTranslation.Create(Properties.Resources.ResourceManager, DummyEnum.AllLanguages, ErrorHandling.ReturnErrorInfo); 18 | Translator.Culture = CultureInfo.GetCultureInfo("en"); 19 | Assert.AreEqual("English", translation.Translated); 20 | 21 | var argses = new List(); 22 | translation.PropertyChanged += (sender, args) => argses.Add(args); 23 | 24 | Translator.Culture = CultureInfo.GetCultureInfo("sv"); 25 | Assert.AreEqual("Svenska", translation.Translated); 26 | Assert.AreEqual(1, argses.Count(x => x.PropertyName == nameof(translation.Translated))); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Johan Larsson 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 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Gu.Wpf.Localization.csproj.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | True 5 | True 6 | True 7 | True -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Internals/ServiceProviderExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization 2 | { 3 | using System; 4 | using System.Windows.Markup; 5 | using System.Xaml; 6 | 7 | internal static class ServiceProviderExt 8 | { 9 | internal static IProvideValueTarget ProvideValueTarget(this IServiceProvider serviceProvider) => serviceProvider.GetService() ?? throw new InvalidOperationException("GetService() returned null"); 10 | 11 | internal static IRootObjectProvider? RootObjectProvider(this IServiceProvider serviceProvider) => serviceProvider.GetService(); 12 | 13 | internal static Type? Resolve(this IServiceProvider serviceProvider, string qualifiedTypeName) 14 | { 15 | if (serviceProvider.GetService() is { } xamlTypeResolver) 16 | { 17 | return xamlTypeResolver.Resolve(qualifiedTypeName); 18 | } 19 | 20 | return null; 21 | } 22 | 23 | private static T? GetService(this IServiceProvider provider) => (T?)provider.GetService(typeof(T)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Gu.Localization.Analyzers.csproj.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | True 5 | True 6 | True 7 | True -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/Helpers/StartInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.UiTests 2 | { 3 | using System.Diagnostics; 4 | using System.Globalization; 5 | using Gu.Wpf.UiAutomation; 6 | 7 | public static class StartInfo 8 | { 9 | public static ProcessStartInfo Demo { get; } = CreateStartUpInfo( 10 | Application.FindExe("Gu.Wpf.Localization.Demo.exe"), 11 | CultureInfo.GetCultureInfo("en")); 12 | 13 | public static ProcessStartInfo WithNeutralResourcesLanguage { get; } = CreateStartUpInfo( 14 | Application.FindExe("Gu.Wpf.Localization.WithNeutralResourcesLanguage.exe"), 15 | CultureInfo.GetCultureInfo("en")); 16 | 17 | private static ProcessStartInfo CreateStartUpInfo(string exeFileName, CultureInfo culture) 18 | { 19 | var processStartInfo = new ProcessStartInfo 20 | { 21 | Arguments = culture.Name, 22 | FileName = exeFileName, 23 | UseShellExecute = false, 24 | RedirectStandardOutput = true, 25 | RedirectStandardError = true, 26 | }; 27 | return processStartInfo; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Gu.Localization.Benchmarks/Gu.Localization.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | latest 7 | Enable 8 | 9 | 10 | 11 | True 12 | AllEnabledByDefault 13 | latest 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/Properties/Settings.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 Gu.Wpf.Localization.Demo.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/Gu.Wpf.Localization.Demo.Controls.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | library 4 | net6.0-windows 5 | true 6 | 7 | 8 | 9 | True 10 | AllEnabledByDefault 11 | latest 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Gu.Localization/MissingTranslationEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System; 4 | using System.Globalization; 5 | 6 | /// 7 | /// Reported by . 8 | /// 9 | public class MissingTranslationEventArgs : EventArgs 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The that a translation was sought for. 15 | /// The resource key a translation was sought for. 16 | public MissingTranslationEventArgs(CultureInfo? language, string key) 17 | { 18 | this.Language = language; 19 | this.Key = key; 20 | } 21 | 22 | /// 23 | /// Gets the that a translation was sought for. 24 | /// 25 | public CultureInfo? Language { get; } 26 | 27 | /// 28 | /// Gets the resource key a translation was sought for. 29 | /// 30 | public string Key { get; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/Windows/LanguageComboBoxWindow.xaml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 17 | 18 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/LanguageSelector/CultureOrDefaultConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization 2 | { 3 | using System; 4 | using System.Globalization; 5 | using System.Windows.Data; 6 | using Gu.Localization; 7 | 8 | /// 9 | [ValueConversion(typeof(CultureInfo), typeof(CultureInfo))] 10 | public sealed class CultureOrDefaultConverter : IValueConverter 11 | { 12 | /// Gets the default instance. 13 | public static readonly CultureOrDefaultConverter Default = new(); 14 | 15 | /// 16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | if (value is CultureInfo ci) 19 | { 20 | return ci; 21 | } 22 | 23 | return Translator.CurrentCulture; 24 | } 25 | 26 | /// 27 | object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 28 | { 29 | if (value is CultureInfo ci) 30 | { 31 | return ci; 32 | } 33 | 34 | return Translator.CurrentCulture; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.NoResources/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 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 Gu.Wpf.Localization.NoResources.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Gu.Localization/Internals/ResourceManagerComparer.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Resources; 6 | 7 | internal sealed class ResourceManagerComparer : IEqualityComparer 8 | { 9 | internal static readonly ResourceManagerComparer ByBaseName = new(); 10 | private static readonly StringComparer StringComparer = StringComparer.Ordinal; 11 | 12 | private ResourceManagerComparer() 13 | { 14 | } 15 | 16 | public bool Equals(ResourceManager? x, ResourceManager? y) 17 | { 18 | if (x is null && y is null) 19 | { 20 | return true; 21 | } 22 | 23 | if (x is null || y is null) 24 | { 25 | return false; 26 | } 27 | 28 | return StringComparer.Equals(x.BaseName, y.BaseName); 29 | } 30 | 31 | public int GetHashCode(ResourceManager obj) 32 | { 33 | if (obj is null) 34 | { 35 | throw new ArgumentNullException(nameof(obj)); 36 | } 37 | 38 | return StringComparer.GetHashCode(obj.BaseName); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 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 Gu.Wpf.Localization.Demo.Controls.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.WithNeutralResourcesLanguage/Properties/Settings.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 Gu.Wpf.Localization.WithNeutralResourcesLanguage.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/Helpers/ResourceTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.Helpers 2 | { 3 | using NUnit.Framework; 4 | 5 | public class ResourceTests 6 | { 7 | [TestCase("Value", "Value")] 8 | [TestCase("Long 123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRST123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRST text", "Long_123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRST123456789abcdefghijklmnopqrstuvxyzABCDEFG")] 9 | [TestCase("Some value", "Some_value")] 10 | [TestCase("Some\r\nvalue", "Some_n_value")] 11 | [TestCase("Some\nvalue", "Some_n_value")] 12 | [TestCase("The value is: {0}", "The_value_is____0__")] 13 | [TestCase("The first value is: {0} and the second value is {1}", "The_first_value_is____0___and_the_second_value_is___1__")] 14 | public void TryGetKey(string text, string expected) 15 | { 16 | if (expected is null) 17 | { 18 | Assert.AreEqual(false, Resources.TryGetKey(text, out _)); 19 | } 20 | else 21 | { 22 | Assert.AreEqual(true, Resources.TryGetKey(text, out var actual)); 23 | Assert.AreEqual(expected, actual); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Tests/LanguageSelector/CultureToFlagPathConverterTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.Tests.LanguageSelector 2 | { 3 | using System.Globalization; 4 | using NUnit.Framework; 5 | 6 | public class CultureToFlagPathConverterTests 7 | { 8 | [TestCase("sv", "pack://application:,,,/Gu.Wpf.Localization;component/Flags/se.png")] 9 | [TestCase("sv-SE", "pack://application:,,,/Gu.Wpf.Localization;component/Flags/se.png")] 10 | [TestCase("fi-FI", "pack://application:,,,/Gu.Wpf.Localization;component/Flags/fi.png")] 11 | [TestCase("FI", "pack://application:,,,/Gu.Wpf.Localization;component/Flags/fi.png")] 12 | [TestCase("en", "pack://application:,,,/Gu.Wpf.Localization;component/Flags/us.png")] 13 | [TestCase("en-US", "pack://application:,,,/Gu.Wpf.Localization;component/Flags/us.png")] 14 | [TestCase("en-GB", "pack://application:,,,/Gu.Wpf.Localization;component/Flags/gb.png")] 15 | public void TryGetFlagPath(string cultureName, string path) 16 | { 17 | var culture = CultureInfo.GetCultureInfo(cultureName); 18 | Assert.AreEqual(true, CultureToFlagPathConverter.TryGetFlagPath(culture, out var actual)); 19 | Assert.AreEqual(path, actual); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/Helpers/KnownSymbols/KnownSymbol.cs: -------------------------------------------------------------------------------- 1 | // ReSharper disable InconsistentNaming 2 | // ReSharper disable UnusedMember.Global 3 | namespace Gu.Localization.Analyzers 4 | { 5 | using Gu.Roslyn.AnalyzerExtensions; 6 | 7 | internal static class KnownSymbol 8 | { 9 | internal static readonly QualifiedType Void = Create("System.Void"); 10 | internal static readonly QualifiedType Object = Create("System.Object", "object"); 11 | internal static readonly QualifiedType Boolean = Create("System.Boolean", "bool"); 12 | internal static readonly QualifiedType Int32 = Create("System.Int32", "int"); 13 | internal static readonly QualifiedType Int64 = Create("System.Int64", "long"); 14 | internal static readonly StringType String = new(); 15 | internal static readonly ResourceManagerType ResourceManager = new(); 16 | internal static readonly TranslatorType Translator = new(); 17 | internal static readonly TranslationType Translation = new(); 18 | internal static readonly QualifiedType ITranslation = new("Gu.Localization.ITranslation"); 19 | 20 | private static QualifiedType Create(string qualifiedName, string? alias = null) 21 | { 22 | return new QualifiedType(qualifiedName, alias); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Gu.Localization.TestStub/Properties/Translate.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.TestStub.Properties 2 | { 3 | public static class Translate 4 | { 5 | /// Call like this: Translate.Key(nameof(Resources.Saved_file__0_)). 6 | /// A key in Properties.Resources 7 | /// How to handle translation errors like missing key or culture. 8 | /// A translation for the key. 9 | public static string Key(string key, ErrorHandling errorHandling = ErrorHandling.ReturnErrorInfoPreserveNeutral) 10 | { 11 | return TranslationFor(key, errorHandling).Translated; 12 | } 13 | 14 | /// Call like this: Translate.Key(nameof(Resources.Saved_file__0_)). 15 | /// A key in Properties.Resources 16 | /// How to handle translation errors like missing key or culture. 17 | /// A translation for the key. 18 | public static ITranslation TranslationFor(string key, ErrorHandling errorHandling = ErrorHandling.ReturnErrorInfoPreserveNeutral) 19 | { 20 | return Gu.Localization.Translation.GetOrCreate(Resources.ResourceManager, key, errorHandling); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/Internals/QualifiedNameAndKey.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable SA1401 // Fields must be private 2 | namespace Gu.Wpf.Localization 3 | { 4 | using System.Collections.Generic; 5 | using System.Text.RegularExpressions; 6 | 7 | internal class QualifiedNameAndKey 8 | { 9 | internal readonly string? QualifiedName; 10 | 11 | internal readonly string Key; 12 | 13 | private static readonly Dictionary Cache = new(); 14 | 15 | private QualifiedNameAndKey(string? qualifiedName, string key) 16 | { 17 | this.QualifiedName = qualifiedName; 18 | this.Key = key; 19 | } 20 | 21 | internal static QualifiedNameAndKey Parse(string member) 22 | { 23 | if (Cache.TryGetValue(member, out var result)) 24 | { 25 | return result; 26 | } 27 | 28 | var match = Regex.Match(member, @"(?\w+:\w+)\.(?\w+)"); 29 | result = !match.Success 30 | ? new QualifiedNameAndKey(null, $"Expecting format 'p:Resources.Key' was:'{member}'") 31 | : new QualifiedNameAndKey(match.Groups["qn"].Value, match.Groups["key"].Value); 32 | 33 | Cache[member] = result; 34 | 35 | return result; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Gu.Localization/ITranslation.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System.ComponentModel; 4 | using System.Globalization; 5 | 6 | /// 7 | /// A translated key. 8 | /// 9 | public interface ITranslation : INotifyPropertyChanged 10 | { 11 | /// 12 | /// Gets the Translated to the 13 | /// This values updates when changes. 14 | /// 15 | string? Translated { get; } 16 | 17 | /// Gets the key for the resource in the . 18 | string Key { get; } 19 | 20 | /// Gets the used by this translation. 21 | ErrorHandling ErrorHandling { get; } 22 | 23 | /// Calls with the key. 24 | /// The culture. 25 | /// Specific how errors are handled. 26 | /// The translated string. 27 | string? Translate(CultureInfo culture, ErrorHandling errorHandlingStrategy = ErrorHandling.Inherit); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo.Controls/DemoUserControl.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/TestHelpers/SolutionExt.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.Helpers 2 | { 3 | using System; 4 | using Microsoft.CodeAnalysis; 5 | 6 | internal static class SolutionExt 7 | { 8 | internal static Document FindDocument(this Solution sln, string name) 9 | { 10 | foreach (var project in sln.Projects) 11 | { 12 | foreach (var document in project.Documents) 13 | { 14 | if (document.Name == name) 15 | { 16 | return document; 17 | } 18 | } 19 | } 20 | 21 | throw new InvalidOperationException($"Did not find a document with name {name}"); 22 | } 23 | 24 | internal static TextDocument FindAdditionalDocument(this Solution sln, string name) 25 | { 26 | foreach (var project in sln.Projects) 27 | { 28 | foreach (var document in project.AdditionalDocuments) 29 | { 30 | if (document.Name == name) 31 | { 32 | return document; 33 | } 34 | } 35 | } 36 | 37 | throw new InvalidOperationException($"Did not find a document with name {name}"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/Gu.Wpf.Localization.Modern.Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | WinExe 4 | net48 5 | true 6 | en 7 | 8 | 9 | 10 | True 11 | AllEnabledByDefault 12 | latest 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Gu.Localization/EnumTranslation{T}.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System; 4 | using System.Globalization; 5 | using System.Resources; 6 | 7 | /// Helper for creating enum translations. 8 | /// An enum type. 9 | [Obsolete("Use non-generic EnumTranslation")] 10 | public static class EnumTranslation 11 | where T : System.Enum 12 | { 13 | /// Create a translation for . 14 | /// The with translations for . 15 | /// The member to translate. 16 | /// Specifies how errors are handled. 17 | /// A . 18 | [Obsolete("Use non-generic EnumTranslation")] 19 | #pragma warning disable CA1000 // Do not declare static members on generic types 20 | public static ITranslation Create(ResourceManager resourceManager, T member, ErrorHandling errorHandling = ErrorHandling.Inherit) 21 | #pragma warning restore CA1000 // Do not declare static members on generic types 22 | { 23 | return Translation.GetOrCreate(resourceManager, member.ToString(CultureInfo.InvariantCulture), errorHandling); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/Gu.Wpf.Localization.Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | WinExe 4 | net6.0-windows 5 | true 6 | latest 7 | 8 | 9 | 10 | True 11 | AllEnabledByDefault 12 | latest 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Gu.Localization.Benchmarks/Program.cs: -------------------------------------------------------------------------------- 1 | // ReSharper disable All 2 | #pragma warning disable 162 3 | namespace Gu.Localization.Benchmarks 4 | { 5 | using System; 6 | using System.IO; 7 | using System.Linq; 8 | using BenchmarkDotNet.Reports; 9 | using BenchmarkDotNet.Running; 10 | 11 | public static class Program 12 | { 13 | public static void Main() 14 | { 15 | if (false) 16 | { 17 | foreach (var summary in new BenchmarkSwitcher(typeof(Program).Assembly).RunAll()) 18 | { 19 | CopyResult(summary); 20 | } 21 | } 22 | else 23 | { 24 | CopyResult(BenchmarkRunner.Run()); 25 | } 26 | } 27 | 28 | private static void CopyResult(Summary summary) 29 | { 30 | var sourceFileName = Directory.EnumerateFiles(summary.ResultsDirectoryPath, $"*{summary.Title}-report-github.md") 31 | .Single(); 32 | var destinationFileName = Path.Combine( 33 | summary.ResultsDirectoryPath.Split(new[] { "\\bin\\" }, StringSplitOptions.RemoveEmptyEntries).First(), 34 | summary.Title.Split('.').Last() + ".md"); 35 | Console.WriteLine($"Copy: {sourceFileName} -> {destinationFileName}"); 36 | File.Copy(sourceFileName, destinationFileName, overwrite: true); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Demo/LanguageSelectorView.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization/MarkupExtensions/CurrentCultureExtension.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization 2 | { 3 | using System; 4 | using System.Reflection; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | 9 | using Gu.Localization; 10 | 11 | /// MarkupExtension for binging to . 12 | [MarkupExtensionReturnType(typeof(BindingExpression))] 13 | public class CurrentCultureExtension : MarkupExtension 14 | { 15 | /// 16 | /// For binding to the static property . 17 | /// 18 | internal static readonly PropertyPath TranslatorCurrentCulturePath = new( 19 | "(0)", 20 | typeof(Translator).GetProperty(nameof(Translator.CurrentCulture), BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly) ?? throw new InvalidOperationException("Did not find property Translator.CurrentCulture.")); 21 | 22 | /// 23 | public override object ProvideValue(IServiceProvider serviceProvider) 24 | { 25 | var binding = new Binding 26 | { 27 | Path = TranslatorCurrentCulturePath, 28 | UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, 29 | Mode = BindingMode.OneWay, 30 | }; 31 | 32 | return binding.ProvideValue(serviceProvider); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/Gu.Localization.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net48 4 | latest 5 | Enable 6 | 7 | 8 | 9 | True 10 | AllEnabledByDefault 11 | latest 12 | 13 | 14 | 15 | true 16 | ..\Gu.Localization.snk 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/tools/install.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | $analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve 4 | 5 | foreach($analyzersPath in $analyzersPaths) 6 | { 7 | # Install the language agnostic analyzers. 8 | if (Test-Path $analyzersPath) 9 | { 10 | foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) 11 | { 12 | if($project.Object.AnalyzerReferences) 13 | { 14 | $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName) 15 | } 16 | } 17 | } 18 | } 19 | 20 | $project.Type # gives the language name like (C# or VB.NET) 21 | $languageFolder = "" 22 | if($project.Type -eq "C#") 23 | { 24 | $languageFolder = "cs" 25 | } 26 | if($project.Type -eq "VB.NET") 27 | { 28 | $languageFolder = "vb" 29 | } 30 | if($languageFolder -eq "") 31 | { 32 | return 33 | } 34 | 35 | foreach($analyzersPath in $analyzersPaths) 36 | { 37 | # Install language specific analyzers. 38 | $languageAnalyzersPath = join-path $analyzersPath $languageFolder 39 | if (Test-Path $languageAnalyzersPath) 40 | { 41 | foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) 42 | { 43 | if($project.Object.AnalyzerReferences) 44 | { 45 | $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName) 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Gu.Localization/Errors/FormatError.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Errors 2 | { 3 | using System.CodeDom.Compiler; 4 | using System.Collections.Generic; 5 | using System.Globalization; 6 | 7 | /// 8 | /// A key that has errors in format parameters. 9 | /// Errors can be: 10 | /// 'First: {1}' (does not start at zero) 11 | /// If different languages have different number of parameters. 12 | /// 13 | public class FormatError : TranslationError 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | /// The resource key. 19 | /// The formats found in current cultures. 20 | public FormatError(string key, IReadOnlyDictionary formats) 21 | : base(key) 22 | { 23 | this.Formats = formats; 24 | } 25 | 26 | /// Gets all formats for all cultures. 27 | public IReadOnlyDictionary Formats { get; } 28 | 29 | internal override void WriteTo(IndentedTextWriter writer) 30 | { 31 | writer.WriteLine("Has format errors, the formats are:"); 32 | writer.Indent++; 33 | foreach (var format in this.Formats) 34 | { 35 | writer.WriteLine(format.Value ?? "null"); 36 | } 37 | 38 | writer.Indent--; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/Internals/ResourceManagersTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Tests.Internals 2 | { 3 | using System; 4 | using System.Resources; 5 | 6 | using NUnit.Framework; 7 | 8 | public class ResourceManagersTests 9 | { 10 | [Test] 11 | public void ForTypeHappyPath() 12 | { 13 | var resourceManager1 = ResourceManagers.ForType(typeof(Properties.Resources)); 14 | var resourceManager2 = ResourceManagers.ForType(typeof(Properties.Resources)); 15 | Assert.AreSame(resourceManager1, resourceManager2); 16 | Assert.AreSame(resourceManager1, Properties.Resources.ResourceManager); 17 | } 18 | 19 | [Test] 20 | public void ForTypeThrows() 21 | { 22 | Assert.Throws(() => ResourceManagers.ForType(typeof(ResourceManager))); 23 | } 24 | 25 | [Test] 26 | public void TryGetForType() 27 | { 28 | Assert.IsTrue(ResourceManagers.TryGetForType(typeof(Properties.Resources), out var resourceManager1)); 29 | Assert.IsTrue(ResourceManagers.TryGetForType(typeof(Properties.Resources), out var resourceManager2)); 30 | Assert.AreSame(resourceManager1, resourceManager2); 31 | Assert.AreSame(resourceManager1, Properties.Resources.ResourceManager); 32 | } 33 | 34 | [Test] 35 | public void TryGetForTypeFails() 36 | { 37 | Assert.IsFalse(ResourceManagers.TryGetForType(typeof(ResourceManager), out _)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/Gu.Wpf.Localization.UiTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0-windows 4 | true 5 | latest 6 | 7 | 8 | 9 | True 10 | AllEnabledByDefault 11 | latest 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Vsix/Gu.Localization.Analyzers.Vsix.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net48 5 | Gu.Localization.Analyzers 6 | Gu.Localization.Analyzers 7 | 8 | 9 | 10 | false 11 | false 12 | false 13 | false 14 | false 15 | false 16 | Roslyn 17 | 18 | 19 | 20 | 21 | False 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers/tools/uninstall.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | $analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve 4 | 5 | foreach($analyzersPath in $analyzersPaths) 6 | { 7 | # Uninstall the language agnostic analyzers. 8 | if (Test-Path $analyzersPath) 9 | { 10 | foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) 11 | { 12 | if($project.Object.AnalyzerReferences) 13 | { 14 | $project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName) 15 | } 16 | } 17 | } 18 | } 19 | 20 | $project.Type # gives the language name like (C# or VB.NET) 21 | $languageFolder = "" 22 | if($project.Type -eq "C#") 23 | { 24 | $languageFolder = "cs" 25 | } 26 | if($project.Type -eq "VB.NET") 27 | { 28 | $languageFolder = "vb" 29 | } 30 | if($languageFolder -eq "") 31 | { 32 | return 33 | } 34 | 35 | foreach($analyzersPath in $analyzersPaths) 36 | { 37 | # Uninstall language specific analyzers. 38 | $languageAnalyzersPath = join-path $analyzersPath $languageFolder 39 | if (Test-Path $languageAnalyzersPath) 40 | { 41 | foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) 42 | { 43 | if($project.Object.AnalyzerReferences) 44 | { 45 | try 46 | { 47 | $project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName) 48 | } 49 | catch 50 | { 51 | 52 | } 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Vsix/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Gu.Localization.Analyzers 6 | Roslyn analyzers INotifyPropertyChanged 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/LocalUserControl.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 29 | 30 | 33 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Gu.Localization/Errors/MissingTranslation.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Errors 2 | { 3 | using System.CodeDom.Compiler; 4 | using System.Collections.Generic; 5 | using System.Globalization; 6 | using System.Linq; 7 | 8 | /// A key that does not have a translation to one or more languages. 9 | public class MissingTranslation : TranslationError 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The resource key. 15 | /// The cultures that does not have a translation. 16 | public MissingTranslation(string key, IReadOnlyList cultures) 17 | : base(key) 18 | { 19 | this.Cultures = cultures; 20 | } 21 | 22 | /// Gets a list of for which there is no translation for the Key. 23 | public IReadOnlyList Cultures { get; } 24 | 25 | /// 26 | public override string ToString() 27 | { 28 | var cultureNames = $" {string.Join(", ", this.Cultures.Select(CultureName))} "; 29 | return $"Missing for: {{{cultureNames}}}"; 30 | } 31 | 32 | internal override void WriteTo(IndentedTextWriter writer) 33 | { 34 | writer.WriteLine(this.ToString()); 35 | } 36 | 37 | private static string CultureName(CultureInfo culture) 38 | { 39 | return culture.IsInvariant() 40 | ? "invariant" 41 | : culture.TwoLetterISOLanguageName; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Modern.Demo/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.Tests/Gu.Wpf.Localization.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0-windows 4 | true 5 | latest 6 | Enable 7 | en 8 | 9 | 10 | 11 | True 12 | AllEnabledByDefault 13 | latest 14 | 15 | 16 | 17 | true 18 | ..\Gu.Localization.snk 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Gu.Wpf.Localization.UiTests/TranslatesWithNeutralResourcesLanguage.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.Localization.UiTests 2 | { 3 | using Gu.Wpf.UiAutomation; 4 | using NUnit.Framework; 5 | 6 | public static class TranslatesWithNeutralResourcesLanguage 7 | { 8 | [OneTimeTearDown] 9 | public static void OneTimeTearDown() 10 | { 11 | Application.KillLaunched(StartInfo.WithNeutralResourcesLanguage.FileName); 12 | } 13 | 14 | [Test] 15 | public static void EffectiveCulture() 16 | { 17 | using var application = Application.AttachOrLaunch(StartInfo.WithNeutralResourcesLanguage); 18 | var window = application.MainWindow; 19 | window.FindRadioButton("en").IsChecked = true; 20 | Assert.AreEqual("en", window.FindTextBlock("CurrentCultureTextBlock").Text); 21 | window.FindRadioButton("pt").IsChecked = true; 22 | Assert.AreEqual("pt", window.FindTextBlock("CurrentCultureTextBlock").Text); 23 | } 24 | 25 | [Test] 26 | public static void VanillaXaml() 27 | { 28 | using var application = Application.AttachOrLaunch(StartInfo.WithNeutralResourcesLanguage); 29 | var window = application.MainWindow; 30 | window.FindRadioButton("en").IsChecked = true; 31 | var groupBox = window.FindGroupBox("Vanilla xaml"); 32 | Assert.AreEqual("English", groupBox.FindTextBlock("AllLanguagesTextBlock").Text); 33 | 34 | window.FindRadioButton("pt").IsChecked = true; 35 | Assert.AreEqual("Português", groupBox.FindTextBlock("AllLanguagesTextBlock").Text); 36 | 37 | window.FindRadioButton("en").IsChecked = true; 38 | Assert.AreEqual("English", groupBox.FindTextBlock("AllLanguagesTextBlock").Text); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Gu.Localization.Tests/Helpers/TranslationSource.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Tests 2 | { 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | 6 | public class TranslationSource : List 7 | { 8 | private static readonly CultureInfo Sv = CultureInfo.GetCultureInfo("sv"); 9 | private static readonly CultureInfo En = CultureInfo.GetCultureInfo("en"); 10 | 11 | public TranslationSource() 12 | { 13 | this.Add(nameof(Properties.Resources.AllLanguages), CultureInfo.InvariantCulture, "So neutral"); 14 | this.Add(nameof(Properties.Resources.AllLanguages), Sv, "Svenska"); 15 | this.Add(nameof(Properties.Resources.AllLanguages), Sv, "Svenska"); 16 | this.Add(nameof(Properties.Resources.EnglishOnly), En, "English"); 17 | this.Add(nameof(Properties.Resources.NeutralOnly), CultureInfo.InvariantCulture, "So neutral"); 18 | } 19 | 20 | private void Add(string key, CultureInfo culture, string expected) 21 | { 22 | this.Add(new Row(key, culture, expected)); 23 | } 24 | 25 | public class Row 26 | { 27 | public Row(string key, CultureInfo culture, string expectedTranslation) 28 | { 29 | this.Key = key; 30 | this.Culture = culture; 31 | this.ExpectedTranslation = expectedTranslation; 32 | } 33 | 34 | public string Key { get; } 35 | 36 | public CultureInfo Culture { get; } 37 | 38 | public string ExpectedTranslation { get; } 39 | 40 | public override string ToString() 41 | { 42 | return $"Key: {this.Key}, Culture: {this.Culture?.Name ?? "null"}, ExpectedTranslation: {this.ExpectedTranslation}"; 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Gu.Localization/Translation.ResourceManagerAndKey.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization 2 | { 3 | using System; 4 | using System.Resources; 5 | 6 | /// Split up nested class. 7 | public partial class Translation 8 | { 9 | private readonly struct ResourceManagerAndKey : IEquatable 10 | { 11 | internal readonly ResourceManager ResourceManager; 12 | internal readonly string Key; 13 | private readonly ErrorHandling errorHandling; 14 | 15 | internal ResourceManagerAndKey(ResourceManager resourceManager, string key, ErrorHandling errorHandling) 16 | { 17 | this.ResourceManager = resourceManager; 18 | this.Key = key; 19 | this.errorHandling = errorHandling; 20 | } 21 | 22 | public bool Equals(ResourceManagerAndKey other) 23 | { 24 | return this.ResourceManager.Equals(other.ResourceManager) && 25 | string.Equals(this.Key, other.Key, StringComparison.Ordinal) && 26 | this.errorHandling == other.errorHandling; 27 | } 28 | 29 | public override bool Equals(object? obj) 30 | { 31 | return obj is ResourceManagerAndKey key && 32 | this.Equals(key); 33 | } 34 | 35 | public override int GetHashCode() 36 | { 37 | unchecked 38 | { 39 | var hashCode = this.ResourceManager.GetHashCode(); 40 | hashCode = (hashCode * 397) ^ StringComparer.InvariantCulture.GetHashCode(this.Key); 41 | hashCode = (hashCode * 397) ^ (int)this.errorHandling; 42 | return hashCode; 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/GULOC06UseInterpolationTests/CodeFix.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.GULOC06UseInterpolationTests 2 | { 3 | using Gu.Roslyn.Asserts; 4 | using Microsoft.CodeAnalysis.Diagnostics; 5 | using NUnit.Framework; 6 | 7 | public static class CodeFix 8 | { 9 | private static readonly DiagnosticAnalyzer Analyzer = new LiteralAnalyzer(); 10 | private static readonly MakeInterpolatedFix Fix = new(); 11 | private static readonly ExpectedDiagnostic ExpectedDiagnostic = ExpectedDiagnostic.Create(Descriptors.GULOC06UseInterpolation); 12 | 13 | [Test] 14 | public static void Interpolated() 15 | { 16 | var before = @" 17 | namespace RoslynSandbox 18 | { 19 | public class Foo 20 | { 21 | public Foo() 22 | { 23 | var translate = ↓""abc {1}""; 24 | } 25 | } 26 | }"; 27 | 28 | var after = @" 29 | namespace RoslynSandbox 30 | { 31 | public class Foo 32 | { 33 | public Foo() 34 | { 35 | var translate = $""abc {1}""; 36 | } 37 | } 38 | }"; 39 | RoslynAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, before, after); 40 | } 41 | 42 | [Test] 43 | public static void InterpolatedVerbatim() 44 | { 45 | var before = @" 46 | namespace RoslynSandbox 47 | { 48 | public class Foo 49 | { 50 | public Foo() 51 | { 52 | var translate = ↓@""abc {1}""; 53 | } 54 | } 55 | }"; 56 | 57 | var after = @" 58 | namespace RoslynSandbox 59 | { 60 | public class Foo 61 | { 62 | public Foo() 63 | { 64 | var translate = $@""abc {1}""; 65 | } 66 | } 67 | }"; 68 | RoslynAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, before, after); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Settings.XamlStyler: -------------------------------------------------------------------------------- 1 | { 2 | "AttributesTolerance": 2, 3 | "KeepFirstAttributeOnSameLine": true, 4 | "MaxAttributeCharactersPerLine": 0, 5 | "MaxAttributesPerLine": 1, 6 | "NewlineExemptionElements": "RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransform, SkewTransform, RotateTransform, TranslateTransform, Trigger, Condition, Setter", 7 | "SeparateByGroups": false, 8 | "AttributeIndentation": 0, 9 | "AttributeIndentationStyle": 1, 10 | "RemoveDesignTimeReferences": false, 11 | "EnableAttributeReordering": true, 12 | "AttributeOrderingRuleGroups": [ 13 | "x:Class", 14 | "xmlns, xmlns:x", 15 | "xmlns:*", 16 | "x:Key, Key, x:Name, Name, x:Uid, Uid, Title", 17 | "Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom", 18 | "Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight", 19 | "Margin, Padding, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment, Panel.ZIndex", 20 | "*:*, *", 21 | "PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint", 22 | "mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText", 23 | "Storyboard.*, From, To, Duration" 24 | ], 25 | "FirstLineAttributes": "", 26 | "OrderAttributesByName": true, 27 | "PutEndingBracketOnNewLine": false, 28 | "RemoveEndingTagOfEmptyElement": true, 29 | "SpaceBeforeClosingSlash": true, 30 | "RootElementLineBreakRule": 0, 31 | "ReorderVSM": 2, 32 | "ReorderGridChildren": true, 33 | "ReorderCanvasChildren": false, 34 | "ReorderSetters": 0, 35 | "FormatMarkupExtension": true, 36 | "NoNewLineMarkupExtensions": "x:Bind, Binding", 37 | "ThicknessSeparator": 2, 38 | "ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin", 39 | "FormatOnSave": false, 40 | "CommentPadding": 2 41 | } -------------------------------------------------------------------------------- /Gu.Localization.Tests/Internals/CultureTests.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Tests.Internals 2 | { 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using NUnit.Framework; 6 | 7 | public class CultureTests 8 | { 9 | private static readonly IReadOnlyList AllCultures = Culture.AllCultures; 10 | 11 | [TestCaseSource(nameof(AllCultures))] 12 | public void TryGetByName(CultureInfo cultureInfo) 13 | { 14 | Assert.AreEqual(true, Culture.TryGet(cultureInfo.Name, out var match)); 15 | Assert.AreEqual(cultureInfo, match); 16 | } 17 | 18 | [TestCaseSource(nameof(AllCultures))] 19 | public void TryGetByTwoLetterISOLanguageName(CultureInfo cultureInfo) 20 | { 21 | Assert.AreEqual(true, Culture.TryGet(cultureInfo.TwoLetterISOLanguageName, out var match)); 22 | Assert.AreEqual(cultureInfo.TwoLetterISOLanguageName, match!.TwoLetterISOLanguageName); 23 | } 24 | 25 | [TestCase("sv", "SE")] 26 | [TestCase("sv-SE", "SE")] 27 | [TestCase("sv-FI", "FI")] 28 | [TestCase("en", "US")] 29 | [TestCase("en-US", "US")] 30 | [TestCase("en-GB", "GB")] 31 | public void TryGetRegion(string cultureName, string regionName) 32 | { 33 | var culture = CultureInfo.GetCultureInfo(cultureName); 34 | Assert.AreEqual(true, Culture.TryGetRegion(culture, out var region)); 35 | Assert.AreEqual(regionName, region!.TwoLetterISORegionName); 36 | } 37 | 38 | [TestCase] 39 | public void TryGetInvalidCulture() 40 | { 41 | Assert.AreEqual(false, Culture.TryGet("foo", out _)); 42 | } 43 | 44 | [TestCase] 45 | public void TryGetRegionForFakeCulture() 46 | { 47 | var fakeCulture = new CultureInfo("foo"); 48 | Assert.AreEqual(false, Culture.TryGetRegion(fakeCulture, out _)); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/GULOC08DuplicateNeutralTests/Valid.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.GULOC08DuplicateNeutralTests 2 | { 3 | using System.IO; 4 | using Gu.Localization.Analyzers.Tests.Helpers; 5 | using Gu.Roslyn.Asserts; 6 | using Microsoft.CodeAnalysis.Diagnostics; 7 | using NUnit.Framework; 8 | 9 | public static class Valid 10 | { 11 | private static readonly DiagnosticAnalyzer Analyzer = new ResourceAnalyzer(); 12 | #pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. 13 | private static FileInfo projectFile; 14 | #pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. 15 | 16 | [SetUp] 17 | public static void SetUp() 18 | { 19 | var original = ProjectFile.Find("Gu.Localization.TestStub.csproj"); 20 | var tempDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), original.Directory!.Name)); 21 | if (tempDir.Exists) 22 | { 23 | tempDir.Delete(recursive: true); 24 | } 25 | 26 | original.Directory.CopyTo(tempDir); 27 | projectFile = tempDir.FindFile(original.Name); 28 | } 29 | 30 | [Test] 31 | public static void WhenValid() 32 | { 33 | projectFile.Directory!.FindFile("Properties\\Resources.resx").ReplaceText("\"Key\"", "\"Value\""); 34 | projectFile.Directory!.FindFile("Properties\\Resources.sv.resx").ReplaceText("\"Key\"", "\"Value\""); 35 | projectFile.Directory!.FindFile("Properties\\Resources.sv-SE.resx").ReplaceText("\"Key\"", "\"Value\""); 36 | projectFile.Directory!.FindFile("Properties\\Resources.Designer.cs").ReplaceText("public static string Key", "public static string Value"); 37 | var solution = CodeFactory.CreateSolution(projectFile); 38 | RoslynAssert.NoAnalyzerDiagnostics(Analyzer, solution); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Gu.Localization.Analyzers.Tests/GULOC10MissingTranslationTests/Valid.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Localization.Analyzers.Tests.GULOC10MissingTranslationTests 2 | { 3 | using System.IO; 4 | using Gu.Localization.Analyzers.Tests.Helpers; 5 | using Gu.Roslyn.Asserts; 6 | using Microsoft.CodeAnalysis.Diagnostics; 7 | using NUnit.Framework; 8 | 9 | public static class Valid 10 | { 11 | private static readonly DiagnosticAnalyzer Analyzer = new ResourceAnalyzer(); 12 | #pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. 13 | private static FileInfo projectFile; 14 | #pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. 15 | 16 | [SetUp] 17 | public static void SetUp() 18 | { 19 | var original = ProjectFile.Find("Gu.Localization.TestStub.csproj"); 20 | var tempDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), original.Directory!.Name)); 21 | if (tempDir.Exists) 22 | { 23 | tempDir.Delete(recursive: true); 24 | } 25 | 26 | original.Directory.CopyTo(tempDir); 27 | projectFile = tempDir.FindFile(original.Name); 28 | } 29 | 30 | [Test] 31 | public static void WhenValid() 32 | { 33 | projectFile.Directory!.FindFile("Properties\\Resources.resx").ReplaceText("\"Key\"", "\"Value\""); 34 | projectFile.Directory!.FindFile("Properties\\Resources.sv.resx").ReplaceText("\"Key\"", "\"Value\""); 35 | projectFile.Directory!.FindFile("Properties\\Resources.sv-SE.resx").ReplaceText("\"Key\"", "\"Value\""); 36 | projectFile.Directory!.FindFile("Properties\\Resources.Designer.cs").ReplaceText("public static string Key", "public static string Value"); 37 | var solution = CodeFactory.CreateSolution(projectFile); 38 | RoslynAssert.NoAnalyzerDiagnostics(Analyzer, solution); 39 | } 40 | } 41 | } 42 | --------------------------------------------------------------------------------