From 9ea0dffeef1d1b0aaa2e69ddbdb13460b5acbfc0 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 17:06:57 -0400 Subject: [PATCH 01/69] Initial structure of crowdin integration --- .../.idea/indexLayout.xml | 1 + .../BaseLayout.resx | 46 +++++++ .../ProjectLighthouse.Localisation.csproj | 17 +++ ProjectLighthouse.sln | 6 + .../Helpers/LocalisationHelper.cs | 4 + ProjectLighthouse/ProjectLighthouse.csproj | 18 +-- crowdin.yml | 116 ++++++++++++++++++ 7 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.resx create mode 100644 ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj create mode 100644 ProjectLighthouse/Helpers/LocalisationHelper.cs create mode 100644 crowdin.yml diff --git a/.idea/.idea.ProjectLighthouse/.idea/indexLayout.xml b/.idea/.idea.ProjectLighthouse/.idea/indexLayout.xml index 022ac2e7..69ba74a2 100644 --- a/.idea/.idea.ProjectLighthouse/.idea/indexLayout.xml +++ b/.idea/.idea.ProjectLighthouse/.idea/indexLayout.xml @@ -12,6 +12,7 @@ ProjectLighthouse.sln.DotSettings.user README.md create-migration.sh + crowdin.yml docker-compose.yml global.json diff --git a/ProjectLighthouse.Localisation/BaseLayout.resx b/ProjectLighthouse.Localisation/BaseLayout.resx new file mode 100644 index 00000000..3734bd86 --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.resx @@ -0,0 +1,46 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file diff --git a/ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj b/ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj new file mode 100644 index 00000000..7905a768 --- /dev/null +++ b/ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + LBPUnion.ProjectLighthouse.Localisation + + + + + ResXFileCodeGenerator + BaseLayout.Designer.cs + + + + diff --git a/ProjectLighthouse.sln b/ProjectLighthouse.sln index 9f80122f..9f7d42c0 100644 --- a/ProjectLighthouse.sln +++ b/ProjectLighthouse.sln @@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Tests.Gam EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Tests.WebsiteTests", "ProjectLighthouse.Tests.WebsiteTests\ProjectLighthouse.Tests.WebsiteTests.csproj", "{CF65EB5B-5364-4D2A-8639-F147A67F08E7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Localisation", "ProjectLighthouse.Localisation\ProjectLighthouse.Localisation.csproj", "{CDB81465-F758-4842-B843-F77ABEE7C3BF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,6 +31,10 @@ Global {CF65EB5B-5364-4D2A-8639-F147A67F08E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF65EB5B-5364-4D2A-8639-F147A67F08E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF65EB5B-5364-4D2A-8639-F147A67F08E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDB81465-F758-4842-B843-F77ABEE7C3BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDB81465-F758-4842-B843-F77ABEE7C3BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDB81465-F758-4842-B843-F77ABEE7C3BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDB81465-F758-4842-B843-F77ABEE7C3BF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {AFC74569-B289-4ACC-B21C-313A3A62C017} = {D360C08E-EA47-43AC-A566-FDF413442980} diff --git a/ProjectLighthouse/Helpers/LocalisationHelper.cs b/ProjectLighthouse/Helpers/LocalisationHelper.cs new file mode 100644 index 00000000..f7d6d580 --- /dev/null +++ b/ProjectLighthouse/Helpers/LocalisationHelper.cs @@ -0,0 +1,4 @@ +namespace LBPUnion.ProjectLighthouse.Helpers; + +public static class LocalisationHelper +{} \ No newline at end of file diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index 3be87bf1..d0c22455 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -51,18 +51,22 @@ Always - - + + - + + + + + - - - - + + + + diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 00000000..6f4e10a3 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,116 @@ +# +# Choose file structure in Crowdin +# e.g. true or false +# +"preserve_hierarchy": true + +files: [ + { + # + # Source files filter + # e.g. "/resources/en/*.json" + # + "source": "/ProjectLighthouse.Localisation/*.resx", + + # + # Where translations will be placed + # e.g. "/resources/%two_letters_code%/%original_file_name%" + # + "translation": "/ProjectLighthouse.Localisation/%file_name%.%locale%.%file_extension%", + + # + # Files or directories for ignore + # e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"] + # + #"ignore" : [], + + # + # The dest allows you to specify a file name in Crowdin + # e.g. "/messages.json" + # + #"dest" : "", + + # + # File type + # e.g. "json" + # + #"type" : "", + + # + # The parameter "update_option" is optional. If it is not set, after the files update the translations for changed strings will be removed. Use to fix typos and for minor changes in the source strings + # e.g. "update_as_unapproved" or "update_without_changes" + # + #"update_option" : "", + + # + # Start block (for XML only) + # + + # + # Defines whether to translate tags attributes. + # e.g. 0 or 1 (Default is 1) + # + # "translate_attributes" : 1, + + # + # Defines whether to translate texts placed inside the tags. + # e.g. 0 or 1 (Default is 1) + # + # "translate_content" : 1, + + # + # This is an array of strings, where each item is the XPaths to DOM element that should be imported + # e.g. ["/content/text", "/content/text[@value]"] + # + # "translatable_elements" : [], + + # + # Defines whether to split long texts into smaller text segments + # e.g. 0 or 1 (Default is 1) + # + # "content_segmentation" : 1, + + # + # End block (for XML only) + # + + # + # Start .properties block + # + + # + # Defines whether single quote should be escaped by another single quote or backslash in exported translations + # e.g. 0 or 1 or 2 or 3 (Default is 3) + # 0 - do not escape single quote; + # 1 - escape single quote by another single quote; + # 2 - escape single quote by backslash; + # 3 - escape single quote by another single quote only in strings containing variables ( {0} ). + # + # "escape_quotes" : 3, + + # + # Defines whether any special characters (=, :, ! and #) should be escaped by backslash in exported translations. + # e.g. 0 or 1 (Default is 0) + # 0 - do not escape special characters + # 1 - escape special characters by a backslash + # + # "escape_special_characters": 0 + # + + # + # End .properties block + # + + # + # Does the first line contain header? + # e.g. true or false + # + #"first_line_contains_header" : true, + + # + # for spreadsheets + # e.g. "identifier,source_phrase,context,uk,ru,fr" + # + # "scheme" : "", + } +] \ No newline at end of file From 3b8510c56cdc643cec6743098b16c4f0f8da906e Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 17:08:14 -0400 Subject: [PATCH 02/69] New translations BaseLayout.resx (English (upside down)) --- .../BaseLayout.en-UD.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.en-UD.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx b/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx new file mode 100644 index 00000000..85cb71dc --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 2e3a17821a563ace3bc0438c105b023d70ad4cf0 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 17:14:43 -0400 Subject: [PATCH 03/69] New translations BaseLayout.resx (English (upside down)) --- ProjectLighthouse.Localisation/BaseLayout.en-UD.resx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx b/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx index 85cb71dc..9192fd03 100644 --- a/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx +++ b/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx @@ -23,22 +23,22 @@ - Home + ǝɯoH A button on the header that takes you to the landing page. - Users + sɹǝs∩ A button on the header that takes you to the user listing. - Photos + soʇoɥԀ A button on the header that takes you to a list of user-uploaded photos. - Levels + slǝʌǝ˥ A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". \ No newline at end of file From 92d0520c90f4f72f414a7a75a4a2138105bc389e Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:42:37 -0400 Subject: [PATCH 04/69] New translations BaseLayout.resx (Danish) --- .../BaseLayout.da-DK.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.da-DK.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.da-DK.resx b/ProjectLighthouse.Localisation/BaseLayout.da-DK.resx new file mode 100644 index 00000000..e9e24854 --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.da-DK.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Forside + A button on the header that takes you to the landing page. + + + + Brugere + A button on the header that takes you to the user listing. + + + + Fotos + A button on the header that takes you to a list of user-uploaded photos. + + + + Baner + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 019a87601cf9d87591d67a3901e9b041bc0171c2 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:42:37 -0400 Subject: [PATCH 05/69] New translations BaseLayout.resx (Japanese) --- .../BaseLayout.ja-JP.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.ja-JP.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.ja-JP.resx b/ProjectLighthouse.Localisation/BaseLayout.ja-JP.resx new file mode 100644 index 00000000..2a576551 --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.ja-JP.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + ホーム + A button on the header that takes you to the landing page. + + + + ユーザー + A button on the header that takes you to the user listing. + + + + 画像 + A button on the header that takes you to a list of user-uploaded photos. + + + + レベル + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 6b8e1f57cb335cc132eba73e95aca504f2379b64 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:42:38 -0400 Subject: [PATCH 06/69] New translations BaseLayout.resx (Polish) --- .../BaseLayout.pl-PL.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.pl-PL.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.pl-PL.resx b/ProjectLighthouse.Localisation/BaseLayout.pl-PL.resx new file mode 100644 index 00000000..c6d5fd7e --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.pl-PL.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Strona Główna + A button on the header that takes you to the landing page. + + + + Gracze + A button on the header that takes you to the user listing. + + + + Zdjęcia + A button on the header that takes you to a list of user-uploaded photos. + + + + Poziomy + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 7bf6c1ee1034f79e0210c1020e7f307567728f38 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:42:39 -0400 Subject: [PATCH 07/69] New translations BaseLayout.resx (Russian) --- .../BaseLayout.ru-RU.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.ru-RU.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.ru-RU.resx b/ProjectLighthouse.Localisation/BaseLayout.ru-RU.resx new file mode 100644 index 00000000..85cb71dc --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.ru-RU.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From c1b4bba20326bbeb0191c506e0f581543fbda992 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:42:40 -0400 Subject: [PATCH 08/69] New translations BaseLayout.resx (Swedish) --- .../BaseLayout.sv-SE.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.sv-SE.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.sv-SE.resx b/ProjectLighthouse.Localisation/BaseLayout.sv-SE.resx new file mode 100644 index 00000000..fbf660ec --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.sv-SE.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Startsida + A button on the header that takes you to the landing page. + + + + Användare + A button on the header that takes you to the user listing. + + + + Foton + A button on the header that takes you to a list of user-uploaded photos. + + + + Banor + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 1ef3ce58ee5a8e1671632bdb59ef8c80a9d49e9b Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:42:41 -0400 Subject: [PATCH 09/69] New translations BaseLayout.resx (Chinese Simplified) --- .../BaseLayout.zh-CN.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.zh-CN.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.zh-CN.resx b/ProjectLighthouse.Localisation/BaseLayout.zh-CN.resx new file mode 100644 index 00000000..3de6a44d --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.zh-CN.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + 主页 + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 7bd0bc0025e073ae96dda2ebf2f593a07e9f7609 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:42:41 -0400 Subject: [PATCH 10/69] New translations BaseLayout.resx (Spanish, Mexico) --- .../BaseLayout.es-MX.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localisation/BaseLayout.es-MX.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.es-MX.resx b/ProjectLighthouse.Localisation/BaseLayout.es-MX.resx new file mode 100644 index 00000000..72657d39 --- /dev/null +++ b/ProjectLighthouse.Localisation/BaseLayout.es-MX.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Inicio + A button on the header that takes you to the landing page. + + + + Usuarios + A button on the header that takes you to the user listing. + + + + Fotos + A button on the header that takes you to a list of user-uploaded photos. + + + + Niveles + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From a340a77d74e34ee486cfa76bd8e0897dc8e2c885 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 18:58:07 -0400 Subject: [PATCH 11/69] Add ability to fetch translations for a given language --- .../ProjectLighthouse.Localisation.csproj | 17 --------- .../BaseLayout.da-DK.resx | 0 .../BaseLayout.en-UD.resx | 0 .../BaseLayout.es-MX.resx | 0 .../BaseLayout.ja-JP.resx | 0 .../BaseLayout.pl-PL.resx | 0 .../BaseLayout.resx | 0 .../BaseLayout.ru-RU.resx | 0 .../BaseLayout.sv-SE.resx | 0 .../BaseLayout.zh-CN.resx | 0 .../LocalizationManager.cs | 36 +++++++++++++++++++ ProjectLighthouse.Localization/Program.cs | 14 ++++++++ .../ProjectLighthouse.Localization.csproj | 11 ++++++ .../TranslationAreas.cs | 6 ++++ ProjectLighthouse.sln | 2 +- ...isationHelper.cs => LocalizationHelper.cs} | 2 +- ProjectLighthouse/ProjectLighthouse.csproj | 6 ++-- crowdin.yml | 27 +++++++------- 18 files changed, 86 insertions(+), 35 deletions(-) delete mode 100644 ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.da-DK.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.en-UD.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.es-MX.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.ja-JP.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.pl-PL.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.ru-RU.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.sv-SE.resx (100%) rename {ProjectLighthouse.Localisation => ProjectLighthouse.Localization}/BaseLayout.zh-CN.resx (100%) create mode 100644 ProjectLighthouse.Localization/LocalizationManager.cs create mode 100644 ProjectLighthouse.Localization/Program.cs create mode 100644 ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj create mode 100644 ProjectLighthouse.Localization/TranslationAreas.cs rename ProjectLighthouse/Helpers/{LocalisationHelper.cs => LocalizationHelper.cs} (55%) diff --git a/ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj b/ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj deleted file mode 100644 index 7905a768..00000000 --- a/ProjectLighthouse.Localisation/ProjectLighthouse.Localisation.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - LBPUnion.ProjectLighthouse.Localisation - - - - - ResXFileCodeGenerator - BaseLayout.Designer.cs - - - - diff --git a/ProjectLighthouse.Localisation/BaseLayout.da-DK.resx b/ProjectLighthouse.Localization/BaseLayout.da-DK.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.da-DK.resx rename to ProjectLighthouse.Localization/BaseLayout.da-DK.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.en-UD.resx b/ProjectLighthouse.Localization/BaseLayout.en-UD.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.en-UD.resx rename to ProjectLighthouse.Localization/BaseLayout.en-UD.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.es-MX.resx b/ProjectLighthouse.Localization/BaseLayout.es-MX.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.es-MX.resx rename to ProjectLighthouse.Localization/BaseLayout.es-MX.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.ja-JP.resx b/ProjectLighthouse.Localization/BaseLayout.ja-JP.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.ja-JP.resx rename to ProjectLighthouse.Localization/BaseLayout.ja-JP.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.pl-PL.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.pl-PL.resx rename to ProjectLighthouse.Localization/BaseLayout.pl-PL.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.resx b/ProjectLighthouse.Localization/BaseLayout.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.resx rename to ProjectLighthouse.Localization/BaseLayout.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.ru-RU.resx b/ProjectLighthouse.Localization/BaseLayout.ru-RU.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.ru-RU.resx rename to ProjectLighthouse.Localization/BaseLayout.ru-RU.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.sv-SE.resx b/ProjectLighthouse.Localization/BaseLayout.sv-SE.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.sv-SE.resx rename to ProjectLighthouse.Localization/BaseLayout.sv-SE.resx diff --git a/ProjectLighthouse.Localisation/BaseLayout.zh-CN.resx b/ProjectLighthouse.Localization/BaseLayout.zh-CN.resx similarity index 100% rename from ProjectLighthouse.Localisation/BaseLayout.zh-CN.resx rename to ProjectLighthouse.Localization/BaseLayout.zh-CN.resx diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs new file mode 100644 index 00000000..944947bb --- /dev/null +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -0,0 +1,36 @@ +using System.Diagnostics; +using System.Reflection; +using System.Resources; + +namespace LBPUnion.ProjectLighthouse.Localization; + +public static class LocalizationManager +{ + private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? ""; + + public static string GetLocalizedString(TranslationAreas translationArea, string language, string key) + { + #if DEBUG + Console.WriteLine($"Attempting to load '{key}' for '{language}' "); + #endif + + string resourceBasename = $"{namespaceStr}.{translationArea.ToString()}.{language}"; + ResourceManager resourceManager = new(resourceBasename, Assembly.GetExecutingAssembly()); + + string? localizedString = resourceManager.GetString(key); + if (localizedString == null) + { + #if DEBUG + if (Debugger.IsAttached) Debugger.Break(); + #endif + return $"{translationArea.ToString()}.{language}.{key}"; + } + + return localizedString; + } + + public static IEnumerable GetAvailableLanguages(TranslationAreas translationArea) + { + return Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(r => r.StartsWith($"{namespaceStr}.{translationArea.ToString()}")); + } +} \ No newline at end of file diff --git a/ProjectLighthouse.Localization/Program.cs b/ProjectLighthouse.Localization/Program.cs new file mode 100644 index 00000000..1e073030 --- /dev/null +++ b/ProjectLighthouse.Localization/Program.cs @@ -0,0 +1,14 @@ +namespace LBPUnion.ProjectLighthouse.Localization; + +public static class Program +{ + public static void Main() + { + Console.WriteLine(LocalizationManager.GetLocalizedString(TranslationAreas.BaseLayout, "en-UD", "header_home")); + Console.WriteLine("Available languages:"); + foreach (string language in LocalizationManager.GetAvailableLanguages(TranslationAreas.BaseLayout)) + { + Console.WriteLine(language); + } + } +} \ No newline at end of file diff --git a/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj b/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj new file mode 100644 index 00000000..824bcb4c --- /dev/null +++ b/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj @@ -0,0 +1,11 @@ + + + + net6.0 + enable + enable + LBPUnion.ProjectLighthouse.Localization + Exe + + + diff --git a/ProjectLighthouse.Localization/TranslationAreas.cs b/ProjectLighthouse.Localization/TranslationAreas.cs new file mode 100644 index 00000000..5b380df0 --- /dev/null +++ b/ProjectLighthouse.Localization/TranslationAreas.cs @@ -0,0 +1,6 @@ +namespace LBPUnion.ProjectLighthouse.Localization; + +public enum TranslationAreas +{ + BaseLayout, +} \ No newline at end of file diff --git a/ProjectLighthouse.sln b/ProjectLighthouse.sln index 9f7d42c0..fde4d678 100644 --- a/ProjectLighthouse.sln +++ b/ProjectLighthouse.sln @@ -10,7 +10,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Tests.Gam EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Tests.WebsiteTests", "ProjectLighthouse.Tests.WebsiteTests\ProjectLighthouse.Tests.WebsiteTests.csproj", "{CF65EB5B-5364-4D2A-8639-F147A67F08E7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Localisation", "ProjectLighthouse.Localisation\ProjectLighthouse.Localisation.csproj", "{CDB81465-F758-4842-B843-F77ABEE7C3BF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Localization", "ProjectLighthouse.Localization\ProjectLighthouse.Localization.csproj", "{CDB81465-F758-4842-B843-F77ABEE7C3BF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/ProjectLighthouse/Helpers/LocalisationHelper.cs b/ProjectLighthouse/Helpers/LocalizationHelper.cs similarity index 55% rename from ProjectLighthouse/Helpers/LocalisationHelper.cs rename to ProjectLighthouse/Helpers/LocalizationHelper.cs index f7d6d580..e22f91d8 100644 --- a/ProjectLighthouse/Helpers/LocalisationHelper.cs +++ b/ProjectLighthouse/Helpers/LocalizationHelper.cs @@ -1,4 +1,4 @@ namespace LBPUnion.ProjectLighthouse.Helpers; -public static class LocalisationHelper +public static class LocalizationHelper {} \ No newline at end of file diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index d0c22455..72987f69 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -43,11 +43,11 @@ Always - + Always - + Always @@ -60,7 +60,7 @@ - + diff --git a/crowdin.yml b/crowdin.yml index 6f4e10a3..9d34341c 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -10,29 +10,30 @@ files: [ # Source files filter # e.g. "/resources/en/*.json" # - "source": "/ProjectLighthouse.Localisation/*.resx", + "source": "/ProjectLighthouse.Localization/*.resx", # # Where translations will be placed # e.g. "/resources/%two_letters_code%/%original_file_name%" # - "translation": "/ProjectLighthouse.Localisation/%file_name%.%locale%.%file_extension%", + "translation": "/ProjectLighthouse.Localization/%file_name%.%locale%.%file_extension%", # # Files or directories for ignore # e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"] # - #"ignore" : [], - - # - # The dest allows you to specify a file name in Crowdin - # e.g. "/messages.json" - # - #"dest" : "", - - # - # File type - # e.g. "json" + ignore: + - "/ProjectLighthouse.Localization/%file_name%.*.%file_extension%" + + # + # The dest allows you to specify a file name in Crowdin + # e.g. "/messages.json" + # + #"dest" : "", + + # + # File type + # e.g. "json" # #"type" : "", From 2b8b0e25a48ec9ebfaf25bed0984339c486a6eb0 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:00:17 -0400 Subject: [PATCH 12/69] Fix scuffed YML --- crowdin.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index 9d34341c..83cbdd10 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -22,18 +22,17 @@ files: [ # Files or directories for ignore # e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"] # - ignore: - - "/ProjectLighthouse.Localization/%file_name%.*.%file_extension%" - - # - # The dest allows you to specify a file name in Crowdin - # e.g. "/messages.json" - # - #"dest" : "", - - # - # File type - # e.g. "json" + "ignore": "/ProjectLighthouse.Localization/%file_name%.*.%file_extension%", + + # + # The dest allows you to specify a file name in Crowdin + # e.g. "/messages.json" + # + #"dest" : "", + + # + # File type + # e.g. "json" # #"type" : "", From 02e18551c7eddb1541489d67137baae4d0132a6b Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:01:32 -0400 Subject: [PATCH 13/69] going insane --- crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crowdin.yml b/crowdin.yml index 83cbdd10..94f9dc46 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -22,7 +22,7 @@ files: [ # Files or directories for ignore # e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"] # - "ignore": "/ProjectLighthouse.Localization/%file_name%.*.%file_extension%", + "ignore": [ "/ProjectLighthouse.Localization/%file_name%.*.%file_extension%" ], # # The dest allows you to specify a file name in Crowdin From c4d4236a5a1b2707852a3ebbb1d9a2cf2c09dafd Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:01 -0400 Subject: [PATCH 14/69] Update Crowdin configuration file --- crowdin.yml | 122 +++------------------------------------------------- 1 file changed, 6 insertions(+), 116 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index 94f9dc46..de770400 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,116 +1,6 @@ -# -# Choose file structure in Crowdin -# e.g. true or false -# -"preserve_hierarchy": true - -files: [ - { - # - # Source files filter - # e.g. "/resources/en/*.json" - # - "source": "/ProjectLighthouse.Localization/*.resx", - - # - # Where translations will be placed - # e.g. "/resources/%two_letters_code%/%original_file_name%" - # - "translation": "/ProjectLighthouse.Localization/%file_name%.%locale%.%file_extension%", - - # - # Files or directories for ignore - # e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"] - # - "ignore": [ "/ProjectLighthouse.Localization/%file_name%.*.%file_extension%" ], - - # - # The dest allows you to specify a file name in Crowdin - # e.g. "/messages.json" - # - #"dest" : "", - - # - # File type - # e.g. "json" - # - #"type" : "", - - # - # The parameter "update_option" is optional. If it is not set, after the files update the translations for changed strings will be removed. Use to fix typos and for minor changes in the source strings - # e.g. "update_as_unapproved" or "update_without_changes" - # - #"update_option" : "", - - # - # Start block (for XML only) - # - - # - # Defines whether to translate tags attributes. - # e.g. 0 or 1 (Default is 1) - # - # "translate_attributes" : 1, - - # - # Defines whether to translate texts placed inside the tags. - # e.g. 0 or 1 (Default is 1) - # - # "translate_content" : 1, - - # - # This is an array of strings, where each item is the XPaths to DOM element that should be imported - # e.g. ["/content/text", "/content/text[@value]"] - # - # "translatable_elements" : [], - - # - # Defines whether to split long texts into smaller text segments - # e.g. 0 or 1 (Default is 1) - # - # "content_segmentation" : 1, - - # - # End block (for XML only) - # - - # - # Start .properties block - # - - # - # Defines whether single quote should be escaped by another single quote or backslash in exported translations - # e.g. 0 or 1 or 2 or 3 (Default is 3) - # 0 - do not escape single quote; - # 1 - escape single quote by another single quote; - # 2 - escape single quote by backslash; - # 3 - escape single quote by another single quote only in strings containing variables ( {0} ). - # - # "escape_quotes" : 3, - - # - # Defines whether any special characters (=, :, ! and #) should be escaped by backslash in exported translations. - # e.g. 0 or 1 (Default is 0) - # 0 - do not escape special characters - # 1 - escape special characters by a backslash - # - # "escape_special_characters": 0 - # - - # - # End .properties block - # - - # - # Does the first line contain header? - # e.g. true or false - # - #"first_line_contains_header" : true, - - # - # for spreadsheets - # e.g. "identifier,source_phrase,context,uk,ru,fr" - # - # "scheme" : "", - } -] \ No newline at end of file +preserve_hierarchy: true +files: + - source: /ProjectLighthouse.Localization/*.resx + translation: /ProjectLighthouse.Localization/%file_name%.%locale%.%file_extension% + ignore: + - /ProjectLighthouse.Localization/%file_name%.*.%file_extension% From 70261b6e132be9ba42104efee8a3caf374cb548e Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:12 -0400 Subject: [PATCH 15/69] New translations BaseLayout.resx (Danish) --- .../BaseLayout.da-DK.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.da-DK.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.da-DK.resx b/ProjectLighthouse.Localization/BaseLayout.da-DK.resx new file mode 100644 index 00000000..e9e24854 --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.da-DK.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Forside + A button on the header that takes you to the landing page. + + + + Brugere + A button on the header that takes you to the user listing. + + + + Fotos + A button on the header that takes you to a list of user-uploaded photos. + + + + Baner + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 5919dcfa706e9798a467aefd4e9835f8d73c42ef Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:13 -0400 Subject: [PATCH 16/69] New translations BaseLayout.resx (Japanese) --- .../BaseLayout.ja-JP.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.ja-JP.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.ja-JP.resx b/ProjectLighthouse.Localization/BaseLayout.ja-JP.resx new file mode 100644 index 00000000..2a576551 --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.ja-JP.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + ホーム + A button on the header that takes you to the landing page. + + + + ユーザー + A button on the header that takes you to the user listing. + + + + 画像 + A button on the header that takes you to a list of user-uploaded photos. + + + + レベル + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From a8fc044da3348382108830e6342990b6c479abbf Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:14 -0400 Subject: [PATCH 17/69] New translations BaseLayout.resx (Polish) --- .../BaseLayout.pl-PL.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.pl-PL.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.pl-PL.resx new file mode 100644 index 00000000..c6d5fd7e --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.pl-PL.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Strona Główna + A button on the header that takes you to the landing page. + + + + Gracze + A button on the header that takes you to the user listing. + + + + Zdjęcia + A button on the header that takes you to a list of user-uploaded photos. + + + + Poziomy + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 0b92ffece10be4ea59a528010ca1fe174010c160 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:15 -0400 Subject: [PATCH 18/69] New translations BaseLayout.resx (Russian) --- .../BaseLayout.ru-RU.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.ru-RU.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.ru-RU.resx b/ProjectLighthouse.Localization/BaseLayout.ru-RU.resx new file mode 100644 index 00000000..85cb71dc --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.ru-RU.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 3ccecd2c8037b28b2df2e46b1b706b8b8053d1ed Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:16 -0400 Subject: [PATCH 19/69] New translations BaseLayout.resx (Swedish) --- .../BaseLayout.sv-SE.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.sv-SE.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.sv-SE.resx b/ProjectLighthouse.Localization/BaseLayout.sv-SE.resx new file mode 100644 index 00000000..fbf660ec --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.sv-SE.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Startsida + A button on the header that takes you to the landing page. + + + + Användare + A button on the header that takes you to the user listing. + + + + Foton + A button on the header that takes you to a list of user-uploaded photos. + + + + Banor + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 1cfe5a7b236a51ff75614ac0969b2ab83b7dd26a Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:17 -0400 Subject: [PATCH 20/69] New translations BaseLayout.resx (Chinese Simplified) --- .../BaseLayout.zh-CN.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.zh-CN.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.zh-CN.resx b/ProjectLighthouse.Localization/BaseLayout.zh-CN.resx new file mode 100644 index 00000000..3de6a44d --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.zh-CN.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + 主页 + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From 9247ce6ccb6505d8fa21787c3e6412591a74c4e7 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:18 -0400 Subject: [PATCH 21/69] New translations BaseLayout.resx (Spanish, Mexico) --- .../BaseLayout.es-MX.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.es-MX.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.es-MX.resx b/ProjectLighthouse.Localization/BaseLayout.es-MX.resx new file mode 100644 index 00000000..72657d39 --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.es-MX.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Inicio + A button on the header that takes you to the landing page. + + + + Usuarios + A button on the header that takes you to the user listing. + + + + Fotos + A button on the header that takes you to a list of user-uploaded photos. + + + + Niveles + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From cf8389c7385537bd153024b4f29ab909b7a59b69 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:03:19 -0400 Subject: [PATCH 22/69] New translations BaseLayout.resx (English (upside down)) --- .../BaseLayout.en-UD.resx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.en-UD.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.en-UD.resx b/ProjectLighthouse.Localization/BaseLayout.en-UD.resx new file mode 100644 index 00000000..9192fd03 --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.en-UD.resx @@ -0,0 +1,44 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + ǝɯoH + A button on the header that takes you to the landing page. + + + + sɹǝs∩ + A button on the header that takes you to the user listing. + + + + soʇoɥԀ + A button on the header that takes you to a list of user-uploaded photos. + + + + slǝʌǝ˥ + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + \ No newline at end of file From c1e9fd361b06ba07f5794eacf2f1834c91894597 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:05 -0400 Subject: [PATCH 23/69] Working localization implementation! --- ....da-DK.resx => BaseLayout.lang-da-DK.resx} | 3 +- ....en-UD.resx => BaseLayout.lang-en-UD.resx} | 3 +- ....es-MX.resx => BaseLayout.lang-es-MX.resx} | 3 +- ....ja-JP.resx => BaseLayout.lang-ja-JP.resx} | 3 +- ....pl-PL.resx => BaseLayout.lang-pl-PL.resx} | 3 +- ....ru-RU.resx => BaseLayout.lang-ru-RU.resx} | 3 +- ....sv-SE.resx => BaseLayout.lang-sv-SE.resx} | 3 +- ....zh-CN.resx => BaseLayout.lang-zh-CN.resx} | 3 +- .../LocalizationManager.cs | 30 +++++++++++++++++-- ProjectLighthouse.Localization/Program.cs | 14 +++++++-- crowdin.yml | 2 +- 11 files changed, 55 insertions(+), 15 deletions(-) rename ProjectLighthouse.Localization/{BaseLayout.da-DK.resx => BaseLayout.lang-da-DK.resx} (94%) rename ProjectLighthouse.Localization/{BaseLayout.en-UD.resx => BaseLayout.lang-en-UD.resx} (94%) rename ProjectLighthouse.Localization/{BaseLayout.es-MX.resx => BaseLayout.lang-es-MX.resx} (94%) rename ProjectLighthouse.Localization/{BaseLayout.ja-JP.resx => BaseLayout.lang-ja-JP.resx} (94%) rename ProjectLighthouse.Localization/{BaseLayout.pl-PL.resx => BaseLayout.lang-pl-PL.resx} (94%) rename ProjectLighthouse.Localization/{BaseLayout.ru-RU.resx => BaseLayout.lang-ru-RU.resx} (94%) rename ProjectLighthouse.Localization/{BaseLayout.sv-SE.resx => BaseLayout.lang-sv-SE.resx} (94%) rename ProjectLighthouse.Localization/{BaseLayout.zh-CN.resx => BaseLayout.lang-zh-CN.resx} (94%) diff --git a/ProjectLighthouse.Localization/BaseLayout.da-DK.resx b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.da-DK.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx index e9e24854..50a2339a 100644 --- a/ProjectLighthouse.Localization/BaseLayout.da-DK.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/BaseLayout.en-UD.resx b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.en-UD.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx index 9192fd03..0931388f 100644 --- a/ProjectLighthouse.Localization/BaseLayout.en-UD.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/BaseLayout.es-MX.resx b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.es-MX.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx index 72657d39..a4498b21 100644 --- a/ProjectLighthouse.Localization/BaseLayout.es-MX.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/BaseLayout.ja-JP.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.ja-JP.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx index 2a576551..110c8042 100644 --- a/ProjectLighthouse.Localization/BaseLayout.ja-JP.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/BaseLayout.pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.pl-PL.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx index c6d5fd7e..cb01d7d1 100644 --- a/ProjectLighthouse.Localization/BaseLayout.pl-PL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/BaseLayout.ru-RU.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.ru-RU.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx index 85cb71dc..a95f118b 100644 --- a/ProjectLighthouse.Localization/BaseLayout.ru-RU.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/BaseLayout.sv-SE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.sv-SE.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx index fbf660ec..9b290691 100644 --- a/ProjectLighthouse.Localization/BaseLayout.sv-SE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/BaseLayout.zh-CN.resx b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx similarity index 94% rename from ProjectLighthouse.Localization/BaseLayout.zh-CN.resx rename to ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx index 3de6a44d..9a349a1b 100644 --- a/ProjectLighthouse.Localization/BaseLayout.zh-CN.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx @@ -1,6 +1,7 @@ - + diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 944947bb..1f3a2d30 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -7,14 +7,24 @@ namespace LBPUnion.ProjectLighthouse.Localization; public static class LocalizationManager { private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? ""; + private const string defaultLang = "en-US"; public static string GetLocalizedString(TranslationAreas translationArea, string language, string key) { #if DEBUG - Console.WriteLine($"Attempting to load '{key}' for '{language}' "); + Console.WriteLine($"Attempting to load '{key}' for '{language}'"); #endif - string resourceBasename = $"{namespaceStr}.{translationArea.ToString()}.{language}"; + string resourceBasename; + if (language == defaultLang) + { + resourceBasename = $"{namespaceStr}.{translationArea.ToString()}"; + } + else + { + resourceBasename = $"{namespaceStr}.{translationArea.ToString()}.lang-{language}"; + } + ResourceManager resourceManager = new(resourceBasename, Assembly.GetExecutingAssembly()); string? localizedString = resourceManager.GetString(key); @@ -31,6 +41,20 @@ public static class LocalizationManager public static IEnumerable GetAvailableLanguages(TranslationAreas translationArea) { - return Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(r => r.StartsWith($"{namespaceStr}.{translationArea.ToString()}")); + string area = translationArea.ToString(); + + // scuffed but it will work for now + List langs = Assembly.GetExecutingAssembly() + .GetManifestResourceNames() + .Where(r => r.StartsWith($"{namespaceStr}.{area}")) + .Select(r => r.Substring(r.IndexOf(area), r.Length - r.IndexOf(area)).Substring(area.Length + 1)) + .Select(r => r.Replace(".resources", string.Empty)) // Remove .resources + .Select(r => r.Replace("lang-", string.Empty)) // Remove 'lang-' prefix from languages + .Where(r => r != "resources") + .ToList(); + + langs.Add(defaultLang); + + return langs; } } \ No newline at end of file diff --git a/ProjectLighthouse.Localization/Program.cs b/ProjectLighthouse.Localization/Program.cs index 1e073030..45af94c6 100644 --- a/ProjectLighthouse.Localization/Program.cs +++ b/ProjectLighthouse.Localization/Program.cs @@ -1,14 +1,22 @@ +using System.Reflection; + namespace LBPUnion.ProjectLighthouse.Localization; public static class Program { public static void Main() { - Console.WriteLine(LocalizationManager.GetLocalizedString(TranslationAreas.BaseLayout, "en-UD", "header_home")); - Console.WriteLine("Available languages:"); + Console.WriteLine("Resource files loaded:"); + foreach (string resourceFile in Assembly.GetExecutingAssembly().GetManifestResourceNames()) + { + Console.WriteLine(" " + resourceFile); + } + + Console.Write('\n'); + foreach (string language in LocalizationManager.GetAvailableLanguages(TranslationAreas.BaseLayout)) { - Console.WriteLine(language); + Console.WriteLine(LocalizationManager.GetLocalizedString(TranslationAreas.BaseLayout, language, "header_home")); } } } \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml index de770400..2e6c5d14 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,6 +1,6 @@ preserve_hierarchy: true files: - source: /ProjectLighthouse.Localization/*.resx - translation: /ProjectLighthouse.Localization/%file_name%.%locale%.%file_extension% + translation: /ProjectLighthouse.Localization/%file_name%.lang-%locale%.%file_extension% ignore: - /ProjectLighthouse.Localization/%file_name%.*.%file_extension% From 405c8bf3ae3653cc277e2c78479d1cc597a15ae6 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:48 -0400 Subject: [PATCH 24/69] New translations BaseLayout.resx (Danish) --- ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx index 50a2339a..e9e24854 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx @@ -1,7 +1,6 @@ - + From 32a256db3901e4129af373814ff878bbd5060091 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:49 -0400 Subject: [PATCH 25/69] New translations BaseLayout.resx (Japanese) --- ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx index 110c8042..2a576551 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx @@ -1,7 +1,6 @@ - + From b3090cc96fdbde6f954de95ac7ff51fcc2fc1221 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:50 -0400 Subject: [PATCH 26/69] New translations BaseLayout.resx (Polish) --- ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx index cb01d7d1..c6d5fd7e 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx @@ -1,7 +1,6 @@ - + From c2a34afad1182c436ba916370644ac05aaa6b0ac Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:51 -0400 Subject: [PATCH 27/69] New translations BaseLayout.resx (Russian) --- ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx index a95f118b..85cb71dc 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx @@ -1,7 +1,6 @@ - + From 3a641ae1948140644998a418f795eb9c569c05ce Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:52 -0400 Subject: [PATCH 28/69] New translations BaseLayout.resx (Swedish) --- ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx index 9b290691..fbf660ec 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx @@ -1,7 +1,6 @@ - + From e4916ce78b7dd1fc0bc493120c243a672263bfde Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:53 -0400 Subject: [PATCH 29/69] New translations BaseLayout.resx (Chinese Simplified) --- .../BaseLayout.lang-zh-CN.resx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx index 9a349a1b..eb24207d 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx @@ -1,7 +1,6 @@ - + @@ -29,17 +28,17 @@ - Users + 用户 A button on the header that takes you to the user listing. - Photos + 图片 A button on the header that takes you to a list of user-uploaded photos. - Levels + 追踪 A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". \ No newline at end of file From f88b0182f47b296a08eb38346d4ef7031ffed13d Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:53 -0400 Subject: [PATCH 30/69] New translations BaseLayout.resx (Spanish, Mexico) --- ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx index a4498b21..72657d39 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx @@ -1,7 +1,6 @@ - + From 4fe7fe76e9d5ab60947d128309b7c5ccbf2efe3b Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 13 Apr 2022 19:39:54 -0400 Subject: [PATCH 31/69] New translations BaseLayout.resx (English (upside down)) --- ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx index 0931388f..9192fd03 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx @@ -1,7 +1,6 @@ - + From 3e18d79fa55906d93245a46dcc277ad7ccf51147 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:24:17 -0400 Subject: [PATCH 32/69] Add translation support to website, read user's language from settings --- .../LocalizationManager.cs | 27 +++++++-------- ProjectLighthouse.Localization/Program.cs | 2 +- .../StringLists/BaseLayoutStrings.cs | 11 ++++++ .../TranslatableString.cs | 21 ++++++++++++ .../Pages/Layouts/BaseLayout.cshtml | 15 ++++---- .../Pages/Layouts/BaseLayout.cshtml.cs | 34 ++++++++++++++----- ProjectLighthouse/Startup/Startup.cs | 20 +++++++++++ ProjectLighthouse/Types/PageNavigationItem.cs | 6 ++-- 8 files changed, 103 insertions(+), 33 deletions(-) create mode 100644 ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs create mode 100644 ProjectLighthouse.Localization/TranslatableString.cs diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 1f3a2d30..9401213b 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -15,15 +15,12 @@ public static class LocalizationManager Console.WriteLine($"Attempting to load '{key}' for '{language}'"); #endif - string resourceBasename; - if (language == defaultLang) - { - resourceBasename = $"{namespaceStr}.{translationArea.ToString()}"; - } - else - { - resourceBasename = $"{namespaceStr}.{translationArea.ToString()}.lang-{language}"; - } + string resourceBasename = $"{namespaceStr}.{translationArea.ToString()}"; + + // We don't have an en-US .resx, so if we aren't using en-US then we need to add the appropriate language. + // Otherwise, keep it to the normal .resx file + // e.g. BaseLayout.resx as opposed to BaseLayout.lang-da-DK.resx. + if (language != defaultLang) resourceBasename += $".lang-{language}"; ResourceManager resourceManager = new(resourceBasename, Assembly.GetExecutingAssembly()); @@ -39,12 +36,12 @@ public static class LocalizationManager return localizedString; } - public static IEnumerable GetAvailableLanguages(TranslationAreas translationArea) + // This is a bit scuffed, but it will work for what I need it to do. + public static IEnumerable GetAvailableLanguages() { - string area = translationArea.ToString(); + string area = TranslationAreas.BaseLayout.ToString(); - // scuffed but it will work for now - List langs = Assembly.GetExecutingAssembly() + List languages = Assembly.GetExecutingAssembly() .GetManifestResourceNames() .Where(r => r.StartsWith($"{namespaceStr}.{area}")) .Select(r => r.Substring(r.IndexOf(area), r.Length - r.IndexOf(area)).Substring(area.Length + 1)) @@ -53,8 +50,8 @@ public static class LocalizationManager .Where(r => r != "resources") .ToList(); - langs.Add(defaultLang); + languages.Add(defaultLang); - return langs; + return languages; } } \ No newline at end of file diff --git a/ProjectLighthouse.Localization/Program.cs b/ProjectLighthouse.Localization/Program.cs index 45af94c6..a4603129 100644 --- a/ProjectLighthouse.Localization/Program.cs +++ b/ProjectLighthouse.Localization/Program.cs @@ -14,7 +14,7 @@ public static class Program Console.Write('\n'); - foreach (string language in LocalizationManager.GetAvailableLanguages(TranslationAreas.BaseLayout)) + foreach (string language in LocalizationManager.GetAvailableLanguages()) { Console.WriteLine(LocalizationManager.GetLocalizedString(TranslationAreas.BaseLayout, language, "header_home")); } diff --git a/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs b/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs new file mode 100644 index 00000000..2b396ce6 --- /dev/null +++ b/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs @@ -0,0 +1,11 @@ +namespace LBPUnion.ProjectLighthouse.Localization.StringLists; + +public static class BaseLayoutStrings +{ + public static readonly TranslatableString HeaderHome = create("header_home"); + public static readonly TranslatableString HeaderUsers = create("header_users"); + public static readonly TranslatableString HeaderPhotos = create("header_photos"); + public static readonly TranslatableString HeaderSlots = create("header_slots"); + + private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key); +} \ No newline at end of file diff --git a/ProjectLighthouse.Localization/TranslatableString.cs b/ProjectLighthouse.Localization/TranslatableString.cs new file mode 100644 index 00000000..4805a2ab --- /dev/null +++ b/ProjectLighthouse.Localization/TranslatableString.cs @@ -0,0 +1,21 @@ +namespace LBPUnion.ProjectLighthouse.Localization; + +public class TranslatableString +{ + public TranslatableString(TranslationAreas area, string key) + { + this.Key = key; + this.Area = area; + } + + public string Key { get; init; } + public TranslationAreas Area { get; init; } + + public string Translate(string language) => LocalizationManager.GetLocalizedString(this.Area, language, this.Key); + + [Obsolete("Do not translate by using ToString. Use TranslatableString.Translate().", true)] + public override string ToString() => "NOT TRANSLATED CORRECTLY!"; + + [Obsolete("Do not translate by using ToString. Use TranslatableString.Translate().", true)] + public static implicit operator string(TranslatableString _) => "NOT TRANSLATED CORRECTLY!"; +} \ No newline at end of file diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml index 279ca575..ef121584 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml @@ -1,5 +1,6 @@ @using LBPUnion.ProjectLighthouse.Helpers @using LBPUnion.ProjectLighthouse.Helpers.Extensions +@using LBPUnion.ProjectLighthouse.Localization @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Settings @model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout @@ -7,21 +8,21 @@ @{ if (Model!.User == null) { - Model.NavigationItemsRight.Add(new PageNavigationItem("Login / Register", "/login", "sign in")); + Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Login / Register"), "/login", "sign in")); } else { if (ServerSettings.Instance.UseExternalAuth) { - Model.NavigationItems.Add(new PageNavigationItem("Authentication", "/authentication", "key")); + Model.NavigationItems.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Authentication"), "/authentication", "key")); } - Model.NavigationItemsRight.Add(new PageNavigationItem("Profile", "/user/" + Model.User.UserId, "user alternate")); + Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Profile"), "/user/" + Model.User.UserId, "user alternate")); @if (Model.User.IsAdmin) { - Model.NavigationItemsRight.Add(new PageNavigationItem("Admin Panel", "/admin", "cogs")); + Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Admin Panel"), "/admin", "cogs")); } - Model.NavigationItemsRight.Add(new PageNavigationItem("Log out", "/logout", "user alternate slash")); // should always be last + Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Log out"), "/logout", "user alternate slash")); // should always be last } Model.IsMobile = Model.Request.IsMobile(); @@ -93,7 +94,7 @@ @if (!Model.IsMobile) { - @navigationItem.Name + @Model.Translate(navigationItem.Name) } } @@ -108,7 +109,7 @@ @if (!Model.IsMobile) { - @navigationItem.Name + @Model.Translate(navigationItem.Name) } } diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs index 58056e32..e1b77818 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs @@ -1,22 +1,19 @@ #nullable enable +using System; using System.Collections.Generic; +using LBPUnion.ProjectLighthouse.Localization; +using LBPUnion.ProjectLighthouse.Localization.StringLists; using LBPUnion.ProjectLighthouse.Types; +using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc.RazorPages; namespace LBPUnion.ProjectLighthouse.Pages.Layouts; public class BaseLayout : PageModel { - public readonly Database Database; - public readonly List NavigationItems = new() - { - new PageNavigationItem("Home", "/", "home"), - new PageNavigationItem("Users", "/users/0", "user friends"), - new PageNavigationItem("Photos", "/photos/0", "camera"), - new PageNavigationItem("Levels", "/slots/0", "certificate"), - }; + public readonly List NavigationItems = new(); public readonly List NavigationItemsRight = new(); public string Description = string.Empty; @@ -31,6 +28,11 @@ public class BaseLayout : PageModel public BaseLayout(Database database) { this.Database = database; + + this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderHome, "/", "home")); + this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderUsers, "/users/0", "user friends")); + this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderPhotos, "/photos/0", "camera")); + this.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderSlots, "/slots/0", "certificate")); } public new User? User { @@ -41,4 +43,20 @@ public class BaseLayout : PageModel } set => this.user = value; } + + public string Translate(TranslatableString translatableString) + { + string lang; + IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get(); + + if (requestCulture == null) lang = "en-UD"; // TODO: change to en-US when i can verify this is working + else + { + lang = requestCulture.RequestCulture.UICulture.Name; + } + + Console.WriteLine(lang); + + return translatableString.Translate(lang); + } } \ No newline at end of file diff --git a/ProjectLighthouse/Startup/Startup.cs b/ProjectLighthouse/Startup/Startup.cs index 97c6833f..488e6371 100644 --- a/ProjectLighthouse/Startup/Startup.cs +++ b/ProjectLighthouse/Startup/Startup.cs @@ -1,9 +1,13 @@ using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.IO; +using System.Linq; using System.Reflection; using Kettu; using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Localization; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Types; @@ -12,6 +16,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.HttpOverrides; +using Microsoft.AspNetCore.Localization; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -85,6 +90,19 @@ public class Startup } ); + services.Configure + ( + config => + { + List languages = LocalizationManager.GetAvailableLanguages().Select(l => new CultureInfo(l)).ToList(); + + config.DefaultRequestCulture = new RequestCulture(new CultureInfo("en-US")); + + config.SupportedCultures = languages; + config.SupportedUICultures = languages; + } + ); + #if DEBUG services.AddSingleton(); #else @@ -123,6 +141,8 @@ public class Startup } ); + app.UseRequestLocalization(); + // Logs every request and the response to it // Example: "200, 13ms: GET /LITTLEBIGPLANETPS3_XML/news" // Example: "404, 127ms: GET /asdasd?query=osucookiezi727ppbluezenithtopplayhdhr" diff --git a/ProjectLighthouse/Types/PageNavigationItem.cs b/ProjectLighthouse/Types/PageNavigationItem.cs index 11068c0a..c7ad4c5d 100644 --- a/ProjectLighthouse/Types/PageNavigationItem.cs +++ b/ProjectLighthouse/Types/PageNavigationItem.cs @@ -1,16 +1,18 @@ +using LBPUnion.ProjectLighthouse.Localization; + #nullable enable namespace LBPUnion.ProjectLighthouse.Types; public class PageNavigationItem { - public PageNavigationItem(string name, string url, string? icon = null) + public PageNavigationItem(TranslatableString name, string url, string? icon = null) { this.Name = name; this.Url = url; this.Icon = icon; } - public string Name { get; set; } + public TranslatableString Name { get; set; } public string Url { get; set; } public string? Icon { get; set; } } \ No newline at end of file From 1b48a71062d3ed88e20969bcbe4963930f217572 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:50:30 -0400 Subject: [PATCH 33/69] Add strings for entire baselayout --- .../BaseLayout.resx | 30 ++++++++++++++++--- .../StringLists/BaseLayoutStrings.cs | 6 ++++ .../Pages/Layouts/BaseLayout.cshtml | 12 ++++---- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.resx b/ProjectLighthouse.Localization/BaseLayout.resx index 3734bd86..cdfeee78 100644 --- a/ProjectLighthouse.Localization/BaseLayout.resx +++ b/ProjectLighthouse.Localization/BaseLayout.resx @@ -25,22 +25,44 @@ - Home + Home A button on the header that takes you to the landing page. - Users + Users A button on the header that takes you to the user listing. - Photos + Photos A button on the header that takes you to a list of user-uploaded photos. - Levels + Levels A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs b/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs index 2b396ce6..91e56acc 100644 --- a/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs +++ b/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs @@ -6,6 +6,12 @@ public static class BaseLayoutStrings public static readonly TranslatableString HeaderUsers = create("header_users"); public static readonly TranslatableString HeaderPhotos = create("header_photos"); public static readonly TranslatableString HeaderSlots = create("header_slots"); + public static readonly TranslatableString HeaderAuthentication = create("header_authentication"); + + public static readonly TranslatableString HeaderLoginRegister = create("header_loginRegister"); + public static readonly TranslatableString HeaderProfile = create("header_profile"); + public static readonly TranslatableString HeaderAdminPanel = create("header_adminPanel"); + public static readonly TranslatableString HeaderLogout = create("header_logout"); private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key); } \ No newline at end of file diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml index ef121584..ebc4355c 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml @@ -1,6 +1,6 @@ @using LBPUnion.ProjectLighthouse.Helpers @using LBPUnion.ProjectLighthouse.Helpers.Extensions -@using LBPUnion.ProjectLighthouse.Localization +@using LBPUnion.ProjectLighthouse.Localization.StringLists @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Settings @model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout @@ -8,21 +8,21 @@ @{ if (Model!.User == null) { - Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Login / Register"), "/login", "sign in")); + Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLoginRegister, "/login", "sign in")); } else { if (ServerSettings.Instance.UseExternalAuth) { - Model.NavigationItems.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Authentication"), "/authentication", "key")); + Model.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAuthentication, "/authentication", "key")); } - Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Profile"), "/user/" + Model.User.UserId, "user alternate")); + Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderProfile, "/user/" + Model.User.UserId, "user alternate")); @if (Model.User.IsAdmin) { - Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Admin Panel"), "/admin", "cogs")); + Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAdminPanel, "/admin", "cogs")); } - Model.NavigationItemsRight.Add(new PageNavigationItem(new TranslatableString(TranslationAreas.BaseLayout, "Log out"), "/logout", "user alternate slash")); // should always be last + Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLogout, "/logout", "user alternate slash")); // should always be last } Model.IsMobile = Model.Request.IsMobile(); From b9103871587f077dae53fb93cf14df220bab1baf Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:06 -0400 Subject: [PATCH 34/69] New translations BaseLayout.resx (Danish) --- .../BaseLayout.lang-da-DK.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx index e9e24854..c16161d6 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx @@ -23,22 +23,44 @@ - Forside + Forside A button on the header that takes you to the landing page. - Brugere + Brugere A button on the header that takes you to the user listing. - Fotos + Fotos A button on the header that takes you to a list of user-uploaded photos. - Baner + Baner A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From 059ca05466f84353c99f3c3ff9d724aa7252b694 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:07 -0400 Subject: [PATCH 35/69] New translations BaseLayout.resx (Japanese) --- .../BaseLayout.lang-ja-JP.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx index 2a576551..21c9a588 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx @@ -23,22 +23,44 @@ - ホーム + ホーム A button on the header that takes you to the landing page. - ユーザー + ユーザー A button on the header that takes you to the user listing. - 画像 + 画像 A button on the header that takes you to a list of user-uploaded photos. - レベル + レベル A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From 24c1987dfe4b9965676d07d2bb4656e097bc3469 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:08 -0400 Subject: [PATCH 36/69] New translations BaseLayout.resx (Polish) --- .../BaseLayout.lang-pl-PL.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx index c6d5fd7e..27471149 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx @@ -23,22 +23,44 @@ - Strona Główna + Strona Główna A button on the header that takes you to the landing page. - Gracze + Gracze A button on the header that takes you to the user listing. - Zdjęcia + Zdjęcia A button on the header that takes you to a list of user-uploaded photos. - Poziomy + Poziomy A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From d3e2b02e02c9d522196c14598a16ed48a1c3aa13 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:09 -0400 Subject: [PATCH 37/69] New translations BaseLayout.resx (Russian) --- .../BaseLayout.lang-ru-RU.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx index 85cb71dc..e338b60b 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx @@ -23,22 +23,44 @@ - Home + Главная A button on the header that takes you to the landing page. - Users + Пользователи A button on the header that takes you to the user listing. - Photos + Фотографии A button on the header that takes you to a list of user-uploaded photos. - Levels + Уровни A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From 26a0af15aa2ac9a4b537a8a39e9471f9808ff34f Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:10 -0400 Subject: [PATCH 38/69] New translations BaseLayout.resx (Swedish) --- .../BaseLayout.lang-sv-SE.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx index fbf660ec..b9ee410a 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx @@ -23,22 +23,44 @@ - Startsida + Startsida A button on the header that takes you to the landing page. - Användare + Användare A button on the header that takes you to the user listing. - Foton + Foton A button on the header that takes you to a list of user-uploaded photos. - Banor + Banor A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From cf6fd0e318244256bd083fe1a717dddedd7776c1 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:11 -0400 Subject: [PATCH 39/69] New translations BaseLayout.resx (Chinese Simplified) --- .../BaseLayout.lang-zh-CN.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx index eb24207d..92d025f2 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx @@ -23,22 +23,44 @@ - 主页 + 主页 A button on the header that takes you to the landing page. - 用户 + 用户 A button on the header that takes you to the user listing. - 图片 + 图片 A button on the header that takes you to a list of user-uploaded photos. - 追踪 + 追踪 A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From e64c583a35a4ada6c7c8ea90eb90c2082ba2cf89 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:12 -0400 Subject: [PATCH 40/69] New translations BaseLayout.resx (Spanish, Mexico) --- .../BaseLayout.lang-es-MX.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx index 72657d39..818f0e6f 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx @@ -23,22 +23,44 @@ - Inicio + Inicio A button on the header that takes you to the landing page. - Usuarios + Usuarios A button on the header that takes you to the user listing. - Fotos + Fotos A button on the header that takes you to a list of user-uploaded photos. - Niveles + Niveles A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From ed0a224fee6c82f7dc22c915b590e68c3b504386 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:13 -0400 Subject: [PATCH 41/69] New translations BaseLayout.resx (English (upside down)) --- .../BaseLayout.lang-en-UD.resx | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx index 9192fd03..09c0ff64 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx @@ -23,22 +23,44 @@ - ǝɯoH + ǝɯoH A button on the header that takes you to the landing page. - sɹǝs∩ + sɹǝs∩ A button on the header that takes you to the user listing. - soʇoɥԀ + soʇoɥԀ A button on the header that takes you to a list of user-uploaded photos. - slǝʌǝ˥ + slǝʌǝ˥ A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + \ No newline at end of file From 83868f7a9cb86dbf19b162f2ce6076dab036e4b9 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:51:14 -0400 Subject: [PATCH 42/69] New translations BaseLayout.resx (Esperanto) --- .../BaseLayout.lang-eo-UY.resx | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx b/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file From 3dd63e6522181082919ca5a8409371cdfaa4d1f7 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 16:53:29 -0400 Subject: [PATCH 43/69] Set default language to en-US --- ProjectLighthouse.Localization/LocalizationManager.cs | 6 +++--- ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 9401213b..7b72021d 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -7,7 +7,7 @@ namespace LBPUnion.ProjectLighthouse.Localization; public static class LocalizationManager { private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? ""; - private const string defaultLang = "en-US"; + public const string DefaultLang = "en-US"; public static string GetLocalizedString(TranslationAreas translationArea, string language, string key) { @@ -20,7 +20,7 @@ public static class LocalizationManager // We don't have an en-US .resx, so if we aren't using en-US then we need to add the appropriate language. // Otherwise, keep it to the normal .resx file // e.g. BaseLayout.resx as opposed to BaseLayout.lang-da-DK.resx. - if (language != defaultLang) resourceBasename += $".lang-{language}"; + if (language != DefaultLang) resourceBasename += $".lang-{language}"; ResourceManager resourceManager = new(resourceBasename, Assembly.GetExecutingAssembly()); @@ -50,7 +50,7 @@ public static class LocalizationManager .Where(r => r != "resources") .ToList(); - languages.Add(defaultLang); + languages.Add(DefaultLang); return languages; } diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs index e1b77818..1d5dcd29 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs @@ -49,7 +49,7 @@ public class BaseLayout : PageModel string lang; IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get(); - if (requestCulture == null) lang = "en-UD"; // TODO: change to en-US when i can verify this is working + if (requestCulture == null) lang = LocalizationManager.DefaultLang; else { lang = requestCulture.RequestCulture.UICulture.Name; From 197aab1ba3e86d20e3b7a0c547253e24168cf356 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 17:06:13 -0400 Subject: [PATCH 44/69] Add landing page strings --- .../LandingPage.resx | 56 +++++++++++++++++++ .../ProjectLighthouse.Localization.csproj | 7 +++ .../StringLists/LandingPageStrings.cs | 15 +++++ .../TranslationAreas.cs | 1 + ProjectLighthouse/Pages/LandingPage.cshtml | 2 +- 5 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 ProjectLighthouse.Localization/LandingPage.resx create mode 100644 ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs diff --git a/ProjectLighthouse.Localization/LandingPage.resx b/ProjectLighthouse.Localization/LandingPage.resx new file mode 100644 index 00000000..627a5769 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.resx @@ -0,0 +1,56 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj b/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj index 824bcb4c..f6397a51 100644 --- a/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj +++ b/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj @@ -8,4 +8,11 @@ Exe + + + ResXFileCodeGenerator + LandingPage.Designer.cs + + + diff --git a/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs b/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs new file mode 100644 index 00000000..e7c46916 --- /dev/null +++ b/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs @@ -0,0 +1,15 @@ +namespace LBPUnion.ProjectLighthouse.Localization.StringLists; + +public static class LandingPageStrings +{ + public static readonly TranslatableString Welcome = create("welcome"); + public static readonly TranslatableString LoggedInAs = create("loggedInAs"); + + public static readonly TranslatableString UsersNone = create("users_none"); + public static readonly TranslatableString UsersSingle = create("users_single"); + public static readonly TranslatableString UsersMultiple = create("users_multiple"); + + public static readonly TranslatableString AuthAttemptsPending = create("authAttemptsPending"); + + private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key); +} \ No newline at end of file diff --git a/ProjectLighthouse.Localization/TranslationAreas.cs b/ProjectLighthouse.Localization/TranslationAreas.cs index 5b380df0..0a4523ee 100644 --- a/ProjectLighthouse.Localization/TranslationAreas.cs +++ b/ProjectLighthouse.Localization/TranslationAreas.cs @@ -3,4 +3,5 @@ namespace LBPUnion.ProjectLighthouse.Localization; public enum TranslationAreas { BaseLayout, + LandingPage, } \ No newline at end of file diff --git a/ProjectLighthouse/Pages/LandingPage.cshtml b/ProjectLighthouse/Pages/LandingPage.cshtml index 47735d4c..098f5e4e 100644 --- a/ProjectLighthouse/Pages/LandingPage.cshtml +++ b/ProjectLighthouse/Pages/LandingPage.cshtml @@ -7,7 +7,7 @@ Layout = "Layouts/BaseLayout"; Model.ShowTitleInPage = false; } -

Welcome to Project Lighthouse!

+

Welcome to Project Lighthouse!

@if (Model.User != null) { From 25621017cd3455041ab6151fb26022742039964d Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 18:11:45 -0400 Subject: [PATCH 45/69] New Crowdin updates (#28) * New translations BaseLayout.resx (Danish) * New translations BaseLayout.resx (Danish) * New translations LandingPage.resx (Japanese) * New translations LandingPage.resx (Filipino) * New translations LandingPage.resx (Esperanto) * New translations LandingPage.resx (Spanish, Mexico) * New translations LandingPage.resx (Chinese Simplified) * New translations LandingPage.resx (Swedish) * New translations LandingPage.resx (Russian) * New translations LandingPage.resx (Polish) * New translations LandingPage.resx (Danish) * New translations BaseLayout.resx (Japanese) * New translations BaseLayout.resx (Filipino) * New translations BaseLayout.resx (Polish) * New translations LandingPage.resx (English (upside down)) --- .../BaseLayout.lang-da-DK.resx | 10 +-- .../BaseLayout.lang-fil-PH.resx | 66 +++++++++++++++++++ .../BaseLayout.lang-ja-JP.resx | 10 +-- .../BaseLayout.lang-pl-PL.resx | 10 +-- .../LandingPage.lang-da-DK.resx | 54 +++++++++++++++ .../LandingPage.lang-en-UD.resx | 54 +++++++++++++++ .../LandingPage.lang-eo-UY.resx | 54 +++++++++++++++ .../LandingPage.lang-es-MX.resx | 54 +++++++++++++++ .../LandingPage.lang-fil-PH.resx | 54 +++++++++++++++ .../LandingPage.lang-ja-JP.resx | 54 +++++++++++++++ .../LandingPage.lang-pl-PL.resx | 54 +++++++++++++++ .../LandingPage.lang-ru-RU.resx | 54 +++++++++++++++ .../LandingPage.lang-sv-SE.resx | 54 +++++++++++++++ .../LandingPage.lang-zh-CN.resx | 54 +++++++++++++++ 14 files changed, 621 insertions(+), 15 deletions(-) create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx index c16161d6..e73812c8 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx @@ -43,24 +43,24 @@ - Authentication + Godkendelse A button on the header that takes you to a list of authentication attempts. - Login / Register + Log ind / Registrer A button on the header that lets you log in or register. - Profile + Profil A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + Administrationspanel A header link that takes you to the admin panel if available. - Log out + Log ud A shortcut to log you out of your account.
\ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx b/ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx index 21c9a588..fb8efb4d 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx @@ -43,24 +43,24 @@ - Authentication + 認証 A button on the header that takes you to a list of authentication attempts. - Login / Register + ログイン/サインアップ A button on the header that lets you log in or register. - Profile + プロフィール A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + 管理者の部屋 A header link that takes you to the admin panel if available. - Log out + ログアウト A shortcut to log you out of your account.
\ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx index 27471149..5c13ed2c 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx @@ -43,24 +43,24 @@ - Authentication + Autoryzacja A button on the header that takes you to a list of authentication attempts. - Login / Register + Login / Rejestracja A button on the header that lets you log in or register. - Profile + Profil A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + Panel Adminów A header link that takes you to the admin panel if available. - Log out + Wyloguj A shortcut to log you out of your account.
\ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx new file mode 100644 index 00000000..d47393ee --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Velkommen til Project Lighthouse! + A greeting on the main page of the website. + + + + Du er i øjeblikket logget ind som {0}. + A greeting on the main page of the website. + + + + Der er ingen brugere online. Hvorfor ikke hoppe på? + A greeting on the main page of the website. + + + + Der er 1 bruger online: + A greeting on the main page of the website. + + + + Der er {0} brugere online: + A greeting on the main page of the website. + + + + Du har {0} godkendelsesforsøg afventende. Klik her for at se dem. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx b/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx new file mode 100644 index 00000000..e5938632 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx new file mode 100644 index 00000000..e5938632 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx new file mode 100644 index 00000000..e5938632 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx b/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx new file mode 100644 index 00000000..e5938632 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx new file mode 100644 index 00000000..1ab12173 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + プロジェクトライトハウスへようこそ + A greeting on the main page of the website. + + + + {0}がログインしています + A greeting on the main page of the website. + + + + オンラインユーザーなし + A greeting on the main page of the website. + + + + 1つのユーザーがオンライン + A greeting on the main page of the website. + + + + {0}つのユーザーがオンライン + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx new file mode 100644 index 00000000..62baf72c --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Witaj w Projekcie Lighthouse! + A greeting on the main page of the website. + + + + Jesteś zalogowany jako {0}. + A greeting on the main page of the website. + + + + Nikt nie jest online. Dlaczego by nie zagrać? + A greeting on the main page of the website. + + + + Jest 1 gracz online: + A greeting on the main page of the website. + + + + Jest {0} graczy online: + A greeting on the main page of the website. + + + + Masz {0} oczekujących prób autoryzacji. Kliknij tutaj, by je zobaczyć. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx new file mode 100644 index 00000000..e5938632 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx new file mode 100644 index 00000000..e5938632 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx b/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx new file mode 100644 index 00000000..e5938632 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx @@ -0,0 +1,54 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to Project Lighthouse! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + \ No newline at end of file From 95d15a887e8609ca55e218c264859340c9ecb3bc Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 14 Apr 2022 23:00:07 -0400 Subject: [PATCH 46/69] New Crowdin updates (#29) * New translations LandingPage.resx (Japanese) * New translations LandingPage.resx (Spanish, Mexico) * New translations BaseLayout.resx (Spanish, Mexico) --- .../BaseLayout.lang-es-MX.resx | 10 +++++----- .../LandingPage.lang-es-MX.resx | 12 ++++++------ .../LandingPage.lang-ja-JP.resx | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx index 818f0e6f..9f37276f 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx @@ -43,24 +43,24 @@ - Authentication + Autenticación A button on the header that takes you to a list of authentication attempts. - Login / Register + Iniciar sesión / Registrarse A button on the header that lets you log in or register. - Profile + Perfil A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + Panel de administración A header link that takes you to the admin panel if available. - Log out + Cerrar sesión A shortcut to log you out of your account.
\ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx index e5938632..f5d5f990 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx @@ -23,32 +23,32 @@ - Welcome to Project Lighthouse! + ¡Bienvenidos al proyecto Lighthouse! A greeting on the main page of the website. - You are currently logged in as {0}. + Estás conectado actualmente como {0} A greeting on the main page of the website. - There are no users online. Why not hop on? + No hay usuarios en línea. ¿Por qué no subirse? A greeting on the main page of the website. - There is 1 user currently online: + Hay 1 usuario actualmente en línea: A greeting on the main page of the website. - There are currently {0} users online: + Actualmente hay {0} usuarios en línea: A greeting on the main page of the website. - You have {0} authentication attempts pending. Click here to view them. + Tiene {0} intentos de autenticación pendientes. Haga clic aquí para verlos. A greeting on the main page of the website.
\ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx index 1ab12173..2ae2774a 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx @@ -48,7 +48,7 @@ - You have {0} authentication attempts pending. Click here to view them. + {0} の認証が保留中です。ここをクリックして確認してください。 A greeting on the main page of the website.
\ No newline at end of file From 156d8393c6f3b7cebaf803f05935c78596f2c11e Mon Sep 17 00:00:00 2001 From: jvyden Date: Fri, 15 Apr 2022 20:49:09 -0400 Subject: [PATCH 47/69] New Crowdin updates (#30) * New translations LandingPage.resx (Russian) * New translations BaseLayout.resx (Russian) --- .../BaseLayout.lang-ru-RU.resx | 10 +++++----- .../LandingPage.lang-ru-RU.resx | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx index e338b60b..b8584493 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx @@ -43,24 +43,24 @@ - Authentication + Аутентификация A button on the header that takes you to a list of authentication attempts. - Login / Register + Вход / Регистрация A button on the header that lets you log in or register. - Profile + Профиль A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + Админпанель A header link that takes you to the admin panel if available. - Log out + Выйти A shortcut to log you out of your account. \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx index e5938632..514df911 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx @@ -23,32 +23,32 @@ - Welcome to Project Lighthouse! + Добро пожаловать в Project Lighthouse! A greeting on the main page of the website. - You are currently logged in as {0}. + Вы вошли как {0} A greeting on the main page of the website. - There are no users online. Why not hop on? + Нет пользователей в сети. Почему бы и не поиграть? A greeting on the main page of the website. - There is 1 user currently online: + Сейчас в сети 1 пользователь: A greeting on the main page of the website. - There are currently {0} users online: + В настоящее время сейчас {0} онлайн: A greeting on the main page of the website. - You have {0} authentication attempts pending. Click here to view them. + У вас есть {0} попыток аутентификации в ожидании. Нажмите здесь, чтобы просмотреть их. A greeting on the main page of the website. \ No newline at end of file From 066f734378616f47c29f3aef17a14f23bfe22283 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sat, 16 Apr 2022 19:03:39 -0400 Subject: [PATCH 48/69] New Crowdin updates (#31) * New translations BaseLayout.resx (English (upside down)) * New translations BaseLayout.resx (Esperanto) * New translations BaseLayout.resx (Polish) * New translations LandingPage.resx (Polish) * New translations LandingPage.resx (Esperanto) * New translations LandingPage.resx (English (upside down)) --- .../BaseLayout.lang-en-UD.resx | 10 +++++----- .../BaseLayout.lang-eo-UY.resx | 18 +++++++++--------- .../BaseLayout.lang-pl-PL.resx | 2 +- .../LandingPage.lang-en-UD.resx | 12 ++++++------ .../LandingPage.lang-eo-UY.resx | 12 ++++++------ .../LandingPage.lang-pl-PL.resx | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx index 09c0ff64..dabdf248 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx @@ -43,24 +43,24 @@ - Authentication + uoıʇɐɔıʇuǝɥʇn∀ A button on the header that takes you to a list of authentication attempts. - Login / Register + ɹǝʇsᴉƃǝɹ / uᴉƃo˥ A button on the header that lets you log in or register. - Profile + ǝlᴉɟoɹԀ A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + lǝuɐԀ uᴉɯp∀ A header link that takes you to the admin panel if available. - Log out + ʇno ƃo˥ A shortcut to log you out of your account. \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx b/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx index c799594c..68388e30 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx @@ -23,44 +23,44 @@ - Home + Hejmo A button on the header that takes you to the landing page. - Users + Uzantoj A button on the header that takes you to the user listing. - Photos + Fotoj A button on the header that takes you to a list of user-uploaded photos. - Levels + Etaĝoj A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". - Authentication + Aŭtentigado A button on the header that takes you to a list of authentication attempts. - Login / Register + Ensaluto / Registro A button on the header that lets you log in or register. - Profile + Profilo A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + Panelo de administranto A header link that takes you to the admin panel if available. - Log out + Adiaŭi A shortcut to log you out of your account. \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx index 5c13ed2c..9ffde647 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx @@ -56,7 +56,7 @@ A quick shortcut on the header to take you to your profile if logged in. - Panel Adminów + Panel Administracyjny A header link that takes you to the admin panel if available. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx b/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx index e5938632..5c805f08 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx @@ -23,32 +23,32 @@ - Welcome to Project Lighthouse! + ¡ǝsnoɥʇɥƃᴉ˥ ʇɔǝɾoɹԀ oʇ ǝɯoɔlǝM A greeting on the main page of the website. - You are currently logged in as {0}. + ˙{0} sɐ uᴉ pǝƃƃol ʎlʇuǝɹɹnɔ ǝɹɐ no⅄ A greeting on the main page of the website. - There are no users online. Why not hop on? + ¿uo doɥ ʇou ʎɥM ˙ǝuᴉluo sɹǝsn ou ǝɹɐ ǝɹǝɥ┴ A greeting on the main page of the website. - There is 1 user currently online: + :ǝuᴉluo ʎlʇuǝɹɹnɔ ɹǝsn Ɩ sᴉ ǝɹǝɥ┴ A greeting on the main page of the website. - There are currently {0} users online: + :ǝuᴉluo sɹǝsn {0} ʎlʇuǝɹɹnɔ ǝɹɐ ǝɹǝɥ┴ A greeting on the main page of the website. - You have {0} authentication attempts pending. Click here to view them. + ˙ɯǝɥʇ ʍǝᴉʌ oʇ ǝɹǝɥ ʞɔᴉlƆ ˙ƃuᴉpuǝd sʇdɯǝʇʇɐ uoᴉʇɐɔᴉʇuǝɥʇnɐ {0} ǝʌɐɥ no⅄ A greeting on the main page of the website. \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx index e5938632..b055ccaa 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx @@ -23,32 +23,32 @@ - Welcome to Project Lighthouse! + Bonvenon al Projekto Lighthouse! A greeting on the main page of the website. - You are currently logged in as {0}. + Vi ensalutinta kiel {0}. A greeting on the main page of the website. - There are no users online. Why not hop on? + Ne estas uzantoj enretaj. Kial ne sursalti? A greeting on the main page of the website. - There is 1 user currently online: + Estas 1 uzanto enreta: A greeting on the main page of the website. - There are currently {0} users online: + Estas {0} uzantoj enretaj: A greeting on the main page of the website. - You have {0} authentication attempts pending. Click here to view them. + Vi havas {0} pritraktatajn aŭtentigajn provojn. Klaku ĉi tie por vidi ilin. A greeting on the main page of the website. \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx index 62baf72c..c0160358 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx @@ -43,7 +43,7 @@ - Jest {0} graczy online: + Obecnie jest {0} graczy online: A greeting on the main page of the website. From 528d3b13359388ee79ec275091745d7e9f38a0d2 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sat, 16 Apr 2022 19:29:31 -0400 Subject: [PATCH 49/69] Add language mappings for non-standard language names --- .../LocalizationManager.cs | 41 +++++++++++++++++++ .../StringLists/LandingPageStrings.cs | 2 +- .../TranslatableString.cs | 4 ++ ProjectLighthouse/Pages/LandingPage.cshtml | 9 ++-- ProjectLighthouse/Startup/Startup.cs | 4 +- 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 7b72021d..4b2d2660 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -11,6 +11,10 @@ public static class LocalizationManager public static string GetLocalizedString(TranslationAreas translationArea, string language, string key) { + // ASP.NET requires specific names for certain languages (like ja for japanese as opposed to the standard ja-JP) + // We map that value back here. + language = mapLanguageBack(language); + #if DEBUG Console.WriteLine($"Attempting to load '{key}' for '{language}'"); #endif @@ -36,6 +40,43 @@ public static class LocalizationManager return localizedString; } + // If a language isn't working, it might be because a language is using a different name than what ASP.NET expects. + // You can retrieve the name of the language from the Accept-Language header in an HTTP request. + private static readonly Dictionary languageMappings = new() + { + { + "ja-JP", "ja" + }, + { + "eo-UY", "eo" + }, + }; + + /// + /// Some languages crowdin uses have names that differ from the ones that ASP.NET expects. This function converts the names. + /// + /// The language to convert to ASP.NET names + /// The name of the language that ASP.NET expects. + public static string MapLanguage(string language) + { + foreach ((string? key, string? value) in languageMappings) + { + if (key == language) return value; + } + + return language; + } + + private static string mapLanguageBack(string language) + { + foreach ((string? key, string? value) in languageMappings) + { + if (value == language) return key; + } + + return language; + } + // This is a bit scuffed, but it will work for what I need it to do. public static IEnumerable GetAvailableLanguages() { diff --git a/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs b/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs index e7c46916..6a0b58d8 100644 --- a/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs +++ b/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs @@ -11,5 +11,5 @@ public static class LandingPageStrings public static readonly TranslatableString AuthAttemptsPending = create("authAttemptsPending"); - private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key); + private static TranslatableString create(string key) => new(TranslationAreas.LandingPage, key); } \ No newline at end of file diff --git a/ProjectLighthouse.Localization/TranslatableString.cs b/ProjectLighthouse.Localization/TranslatableString.cs index 4805a2ab..89530be6 100644 --- a/ProjectLighthouse.Localization/TranslatableString.cs +++ b/ProjectLighthouse.Localization/TranslatableString.cs @@ -13,8 +13,12 @@ public class TranslatableString public string Translate(string language) => LocalizationManager.GetLocalizedString(this.Area, language, this.Key); + // CS0809 is a warning about obsolete methods overriding non-obsoleted methods. + // That works against what we're trying to do here, so we disable the warning here. + #pragma warning disable CS0809 [Obsolete("Do not translate by using ToString. Use TranslatableString.Translate().", true)] public override string ToString() => "NOT TRANSLATED CORRECTLY!"; + #pragma warning restore CS0809 [Obsolete("Do not translate by using ToString. Use TranslatableString.Translate().", true)] public static implicit operator string(TranslatableString _) => "NOT TRANSLATED CORRECTLY!"; diff --git a/ProjectLighthouse/Pages/LandingPage.cshtml b/ProjectLighthouse/Pages/LandingPage.cshtml index 098f5e4e..99b4484f 100644 --- a/ProjectLighthouse/Pages/LandingPage.cshtml +++ b/ProjectLighthouse/Pages/LandingPage.cshtml @@ -1,4 +1,5 @@ @page "/" +@using LBPUnion.ProjectLighthouse.Localization.StringLists @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Settings @model LBPUnion.ProjectLighthouse.Pages.LandingPage @@ -7,11 +8,11 @@ Layout = "Layouts/BaseLayout"; Model.ShowTitleInPage = false; } -

Welcome to Project Lighthouse!

+

@Model.Translate(LandingPageStrings.Welcome)

@if (Model.User != null) { -

You are currently logged in as @Model.User.Username.

+

@string.Format(Model.Translate(LandingPageStrings.LoggedInAs), $"{Model.User.Username}")

// TODO: make this bold if (ServerSettings.Instance.UseExternalAuth && Model.AuthenticationAttemptsCount > 0) {

@@ -22,7 +23,7 @@ @if (Model.PlayersOnlineCount == 1) { -

There is 1 user currently online:

+

@Model.Translate(LandingPageStrings.UsersSingle)

@foreach (User user in Model.PlayersOnline) { @user.Username @@ -31,7 +32,7 @@ else if (Model.PlayersOnlineCount == 0) { -

There are no users online. Why not hop on?

+

@Model.Translate(LandingPageStrings.UsersNone)

} else { diff --git a/ProjectLighthouse/Startup/Startup.cs b/ProjectLighthouse/Startup/Startup.cs index 488e6371..fb78e597 100644 --- a/ProjectLighthouse/Startup/Startup.cs +++ b/ProjectLighthouse/Startup/Startup.cs @@ -94,7 +94,9 @@ public class Startup ( config => { - List languages = LocalizationManager.GetAvailableLanguages().Select(l => new CultureInfo(l)).ToList(); + List languages = LocalizationManager.GetAvailableLanguages() + .Select(l => new CultureInfo(LocalizationManager.MapLanguage(l))) + .ToList(); config.DefaultRequestCulture = new RequestCulture(new CultureInfo("en-US")); From dc3aa96634d2a0c4ec3fd10dbe31434bf43065fa Mon Sep 17 00:00:00 2001 From: jvyden Date: Sun, 17 Apr 2022 16:24:20 -0400 Subject: [PATCH 50/69] Remove english upside down from language list This cannot be accessed through the browser, and was initially used for testing anyways, so /shrug --- .../BaseLayout.lang-en-UD.resx | 66 ------------------- .../LandingPage.lang-en-UD.resx | 54 --------------- 2 files changed, 120 deletions(-) delete mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx delete mode 100644 ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx b/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx deleted file mode 100644 index dabdf248..00000000 --- a/ProjectLighthouse.Localization/BaseLayout.lang-en-UD.resx +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - - ǝɯoH - A button on the header that takes you to the landing page. - - - - sɹǝs∩ - A button on the header that takes you to the user listing. - - - - soʇoɥԀ - A button on the header that takes you to a list of user-uploaded photos. - - - - slǝʌǝ˥ - A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". - - - - uoıʇɐɔıʇuǝɥʇn∀ - A button on the header that takes you to a list of authentication attempts. - - - - ɹǝʇsᴉƃǝɹ / uᴉƃo˥ - A button on the header that lets you log in or register. - - - ǝlᴉɟoɹԀ - A quick shortcut on the header to take you to your profile if logged in. - - - lǝuɐԀ uᴉɯp∀ - A header link that takes you to the admin panel if available. - - - ʇno ƃo˥ - A shortcut to log you out of your account. - - \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx b/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx deleted file mode 100644 index 5c805f08..00000000 --- a/ProjectLighthouse.Localization/LandingPage.lang-en-UD.resx +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - - ¡ǝsnoɥʇɥƃᴉ˥ ʇɔǝɾoɹԀ oʇ ǝɯoɔlǝM - A greeting on the main page of the website. - - - - ˙{0} sɐ uᴉ pǝƃƃol ʎlʇuǝɹɹnɔ ǝɹɐ no⅄ - A greeting on the main page of the website. - - - - ¿uo doɥ ʇou ʎɥM ˙ǝuᴉluo sɹǝsn ou ǝɹɐ ǝɹǝɥ┴ - A greeting on the main page of the website. - - - - :ǝuᴉluo ʎlʇuǝɹɹnɔ ɹǝsn Ɩ sᴉ ǝɹǝɥ┴ - A greeting on the main page of the website. - - - - :ǝuᴉluo sɹǝsn {0} ʎlʇuǝɹɹnɔ ǝɹɐ ǝɹǝɥ┴ - A greeting on the main page of the website. - - - - ˙ɯǝɥʇ ʍǝᴉʌ oʇ ǝɹǝɥ ʞɔᴉlƆ ˙ƃuᴉpuǝd sʇdɯǝʇʇɐ uoᴉʇɐɔᴉʇuǝɥʇnɐ {0} ǝʌɐɥ no⅄ - A greeting on the main page of the website. - - \ No newline at end of file From 8adbab15d12575f164cf67e4d93c2211d507abf9 Mon Sep 17 00:00:00 2001 From: jvyden Date: Fri, 10 Jun 2022 04:31:37 -0400 Subject: [PATCH 51/69] Use request localization in website startup --- ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs b/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs index dabe84c2..c32854bf 100644 --- a/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs +++ b/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs @@ -60,6 +60,8 @@ public class WebsiteStartup app.UseStaticFiles(); + app.UseRequestLocalization(); + app.UseEndpoints(endpoints => endpoints.MapControllers()); app.UseEndpoints(endpoints => endpoints.MapRazorPages()); } From 7fb8b52a99be7d8cf3d9a3230483c4c3d8ec80f3 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 16:01:20 -0400 Subject: [PATCH 52/69] Update contribution guidelines and readme to reflect RPCS3 official patch Closes #362 --- CONTRIBUTING.md | 7 ++----- README.md | 16 ++++++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d72edc6..d2da1519 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,9 +17,6 @@ Once you've gotten MySQL running you can run Lighthouse. It will take care of th PS3 is difficult to set up, so I will be going over how to set up RPCS3 instead. A guide will be coming for PS3 closer to release. You can also follow this guide if you want to learn how to modify your EBOOT. -*Note: This requires a patched copy of RPCS3. You can find a working -version [on our GitHub](https://github.com/LBPUnion/rpcs3).* - Start by getting a copy of LittleBigPlanet 1/2 installed. (Check the LittleBigPlanet 1 section, since you'll need to do extra steps for your game to not crash upon entering pod computer). @@ -44,8 +41,8 @@ Now, copy the `EBOOTlocalhost.elf` file to where you got your `EBOOT.elf` file f To launch the game with the patched EBOOT, open up RPCS3, go to File, Boot SELF/ELF, and open up `EBOOTlocalhost.elf`. -Assuming you are running the patched version of RPCS3, you patched the file correctly, the database is migrated, and -Project Lighthouse is running, the game should now connect and you may begin contributing! +Assuming you patched the file correctly, the database is migrated, and +Project Lighthouse is running, the game should now connect, and you may begin contributing! ### LittleBigPlanet 1 diff --git a/README.md b/README.md index 903e3baf..a91d5d3d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ environment until release**. This is because we have not entirely nailed security down yet, and **your instance WILL get attacked** as a result. It's happened before, and it'll happen again. -Simply put, **Project Lighthouse is not ready for the general public yet**. +Simply put, **Project Lighthouse is not ready for the public yet**. In addition, we're not responsible if someone hacks your machine and wipes your database, so make frequent backups, and be sure to report any vulnerabilities. Thank you in advance. @@ -61,12 +61,12 @@ information. ## Compatibility across games and platforms -| Game | Console (PS3/Vita/PSP) | Emulator (RPCS3/Vita3k/PPSSPP) | Next-Gen (PS4/PS5/Vita) | -|----------|-------------------------------------|--------------------------------------------------------------|-------------------------| -| LBP1 | Compatible | Compatible with patched RPCS3 build | No next-gen equivalent | -| LBP2 | Compatible | Compatible with patched RPCS3 build | No next-gen equivalent | -| LBP3 | Mostly compatible, frequent crashes | Mostly compatible with patched RPCS3 build, frequent crashes | Incompatible | -| LBP Vita | Compatible | Incompatible, marked as "Intro" on Vita3k | No next-gen equivalent | -| LBP PSP | Potentially compatible | Incompatible, PSN not supported on PPSSPP | Potentially Compatible | +| Game | Console (PS3/Vita/PSP) | Emulator (RPCS3/Vita3k/PPSSPP) | Next-Gen (PS4/PS5/Adrenaline) | +|----------|------------------------|-------------------------------------------|-------------------------------| +| LBP1 | Compatible | Compatible | No next-gen equivalent | +| LBP2 | Compatible | Compatible | No next-gen equivalent | +| LBP3 | Mostly compatible | Mostly compatible | Incompatible | +| LBP Vita | Compatible | Incompatible, PSN not supported on Vita3k | No next-gen equivalent | +| LBP PSP | Potentially compatible | Incompatible, PSN not supported on PPSSPP | Potentially Compatible | Project Lighthouse is mostly a work in progress, so this chart is subject to change at any point. From 500fdc2186f07334bc5541148adac5ccf4a66312 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 16:27:27 -0400 Subject: [PATCH 53/69] Add instance name to LandingPage.welcome --- ProjectLighthouse.Localization/LandingPage.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse.Localization/LandingPage.resx b/ProjectLighthouse.Localization/LandingPage.resx index 627a5769..b277bcf8 100644 --- a/ProjectLighthouse.Localization/LandingPage.resx +++ b/ProjectLighthouse.Localization/LandingPage.resx @@ -25,7 +25,7 @@ - Welcome to Project Lighthouse! + Welcome to {0}! A greeting on the main page of the website. From 51228b2ca122a172a519b46cfe38cdceb4ac1134 Mon Sep 17 00:00:00 2001 From: Jayden Date: Tue, 26 Jul 2022 16:28:39 -0400 Subject: [PATCH 54/69] New Crowdin updates (#54) * New translations LandingPage.resx (Japanese) * New translations LandingPage.resx (Esperanto) * New translations LandingPage.resx (Spanish, Mexico) * New translations LandingPage.resx (Chinese Simplified) * New translations LandingPage.resx (Swedish) * New translations LandingPage.resx (Russian) * New translations LandingPage.resx (Polish) * New translations LandingPage.resx (Danish) * New translations LandingPage.resx (Filipino) --- ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx | 2 +- ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx index d47393ee..40392a75 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx @@ -23,7 +23,7 @@ - Velkommen til Project Lighthouse! + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx index b055ccaa..8bc82c85 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx @@ -23,7 +23,7 @@ - Bonvenon al Projekto Lighthouse! + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx index f5d5f990..44dd3f75 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx @@ -23,7 +23,7 @@ - ¡Bienvenidos al proyecto Lighthouse! + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx b/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx index e5938632..86c33871 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx @@ -23,7 +23,7 @@ - Welcome to Project Lighthouse! + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx index 2ae2774a..99bacf7e 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx @@ -23,7 +23,7 @@ - プロジェクトライトハウスへようこそ + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx index c0160358..25736bd6 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx @@ -23,7 +23,7 @@ - Witaj w Projekcie Lighthouse! + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx index 514df911..0361beff 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx @@ -23,7 +23,7 @@ - Добро пожаловать в Project Lighthouse! + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx index e5938632..86c33871 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx @@ -23,7 +23,7 @@ - Welcome to Project Lighthouse! + Welcome to {0}! A greeting on the main page of the website. diff --git a/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx b/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx index e5938632..86c33871 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx @@ -23,7 +23,7 @@ - Welcome to Project Lighthouse! + Welcome to {0}! A greeting on the main page of the website. From 1e9f672d6c5a542a1c6e62448ecb3df30ffa859a Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 16:44:19 -0400 Subject: [PATCH 55/69] Finish translation of landing page --- .../LandingPage.resx | 8 ++++++++ .../LocalizationManager.cs | 2 +- .../StringLists/LandingPageStrings.cs | 3 +++ .../TranslatableString.cs | 2 ++ .../Pages/LandingPage.cshtml | 19 +++++++++--------- .../Pages/LandingPage.cshtml.cs | 4 ++-- .../Pages/Layouts/BaseLayout.cshtml.cs | 20 ++++++++----------- 7 files changed, 34 insertions(+), 24 deletions(-) diff --git a/ProjectLighthouse.Localization/LandingPage.resx b/ProjectLighthouse.Localization/LandingPage.resx index b277bcf8..287660e3 100644 --- a/ProjectLighthouse.Localization/LandingPage.resx +++ b/ProjectLighthouse.Localization/LandingPage.resx @@ -53,4 +53,12 @@ You have {0} authentication attempts pending. Click here to view them. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 4b2d2660..6f63cf8a 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -7,7 +7,7 @@ namespace LBPUnion.ProjectLighthouse.Localization; public static class LocalizationManager { private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? ""; - public const string DefaultLang = "en-US"; + public const string DefaultLang = "ja-JP"; public static string GetLocalizedString(TranslationAreas translationArea, string language, string key) { diff --git a/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs b/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs index 6a0b58d8..7ec962e8 100644 --- a/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs +++ b/ProjectLighthouse.Localization/StringLists/LandingPageStrings.cs @@ -9,6 +9,9 @@ public static class LandingPageStrings public static readonly TranslatableString UsersSingle = create("users_single"); public static readonly TranslatableString UsersMultiple = create("users_multiple"); + public static readonly TranslatableString LatestTeamPicks = create("latest_team_picks"); + public static readonly TranslatableString NewestLevels = create("newest_levels"); + public static readonly TranslatableString AuthAttemptsPending = create("authAttemptsPending"); private static TranslatableString create(string key) => new(TranslationAreas.LandingPage, key); diff --git a/ProjectLighthouse.Localization/TranslatableString.cs b/ProjectLighthouse.Localization/TranslatableString.cs index 89530be6..633a5eb4 100644 --- a/ProjectLighthouse.Localization/TranslatableString.cs +++ b/ProjectLighthouse.Localization/TranslatableString.cs @@ -13,6 +13,8 @@ public class TranslatableString public string Translate(string language) => LocalizationManager.GetLocalizedString(this.Area, language, this.Key); + public string Translate(string language, params object?[] format) => string.Format(LocalizationManager.GetLocalizedString(this.Area, language, this.Key), format); + // CS0809 is a warning about obsolete methods overriding non-obsoleted methods. // That works against what we're trying to do here, so we disable the warning here. #pragma warning disable CS0809 diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml index c881ae1e..60dbddf0 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml @@ -3,6 +3,7 @@ @using LBPUnion.ProjectLighthouse.Extensions @using LBPUnion.ProjectLighthouse.PlayerData.Profiles @using LBPUnion.ProjectLighthouse.Levels +@using LBPUnion.ProjectLighthouse.Localization.StringLists @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.LandingPage @{ @@ -10,22 +11,22 @@ Model.ShowTitleInPage = false; bool isMobile = this.Request.IsMobile(); } -

Welcome to @ServerConfiguration.Instance.Customization.ServerName!

+

@Model.Translate(LandingPageStrings.Welcome, ServerConfiguration.Instance.Customization.ServerName)

@if (Model.User != null) { -

You are currently logged in as @Model.User.Username.

- if (ServerConfiguration.Instance.Authentication.UseExternalAuth && Model.AuthenticationAttemptsCount > 0) +

@Model.Translate(LandingPageStrings.LoggedInAs, Model.User.Username)

+ if (ServerConfiguration.Instance.Authentication.UseExternalAuth && Model.PendingAuthAttempts > 0) {

- You have @Model.AuthenticationAttemptsCount authentication attempts pending. Click here to view them. + @Model.Translate(LandingPageStrings.AuthAttemptsPending, Model.PendingAuthAttempts)

} } @if (Model.PlayersOnlineCount == 1) { -

There is 1 user currently online:

+

@Model.Translate(LandingPageStrings.UsersSingle)

@foreach (User user in Model.PlayersOnline) { @user.Username @@ -34,11 +35,11 @@ else if (Model.PlayersOnlineCount == 0) { -

There are no users online. Why not hop on?

+

@Model.Translate(LandingPageStrings.UsersNone)

} else { -

There are currently @Model.PlayersOnlineCount users online:

+

@Model.Translate(LandingPageStrings.UsersMultiple, Model.PlayersOnlineCount)

@foreach (User user in Model.PlayersOnline) { @user.Username @@ -50,7 +51,7 @@ else
-

Latest Team Picks

+

@Model.Translate(LandingPageStrings.LatestTeamPicks)

@foreach (Slot slot in Model.LatestTeamPicks!) @* Can't reach a point where this is null *@ @@ -67,7 +68,7 @@ else }
-

Newest Levels

+

@Model.Translate(LandingPageStrings.NewestLevels)

@foreach (Slot slot in Model.NewestLevels!) @* Can't reach a point where this is null *@ diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs index 20b13dbc..fecee91b 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs @@ -15,7 +15,7 @@ public class LandingPage : BaseLayout public LandingPage(Database database) : base(database) {} - public int AuthenticationAttemptsCount; + public int PendingAuthAttempts; public List PlayersOnline = new(); public int PlayersOnlineCount; @@ -32,7 +32,7 @@ public class LandingPage : BaseLayout this.PlayersOnlineCount = await StatisticsHelper.RecentMatches(); if (user != null) - this.AuthenticationAttemptsCount = await this.Database.AuthenticationAttempts.Include + this.PendingAuthAttempts = await this.Database.AuthenticationAttempts.Include (a => a.GameToken) .CountAsync(a => a.GameToken.UserId == user.UserId); diff --git a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs index 9ea0510f..c8c8e882 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs @@ -45,19 +45,15 @@ public class BaseLayout : PageModel set => this.user = value; } - public string Translate(TranslatableString translatableString) + private string getLanguage() { - string lang; + return "da-DK"; IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get(); - - if (requestCulture == null) lang = LocalizationManager.DefaultLang; - else - { - lang = requestCulture.RequestCulture.UICulture.Name; - } - - Console.WriteLine(lang); - - return translatableString.Translate(lang); + + if (requestCulture == null) return LocalizationManager.DefaultLang; + return requestCulture.RequestCulture.UICulture.Name; } + + public string Translate(TranslatableString translatableString) => translatableString.Translate(this.getLanguage()); + public string Translate(TranslatableString translatableString, params object?[] format) => translatableString.Translate(this.getLanguage(), format); } \ No newline at end of file From 4fe8be135f340f11cd4f62f5b475693b1d22a9cf Mon Sep 17 00:00:00 2001 From: Jayden Date: Tue, 26 Jul 2022 16:45:04 -0400 Subject: [PATCH 56/69] New Crowdin updates (#55) * New translations LandingPage.resx (Japanese) * New translations LandingPage.resx (Esperanto) * New translations LandingPage.resx (Spanish, Mexico) * New translations LandingPage.resx (Chinese Simplified) * New translations LandingPage.resx (Swedish) * New translations LandingPage.resx (Russian) * New translations LandingPage.resx (Polish) * New translations LandingPage.resx (Danish) * New translations LandingPage.resx (Filipino) --- .../LandingPage.lang-da-DK.resx | 8 ++++++++ .../LandingPage.lang-eo-UY.resx | 8 ++++++++ .../LandingPage.lang-es-MX.resx | 8 ++++++++ .../LandingPage.lang-fil-PH.resx | 8 ++++++++ .../LandingPage.lang-ja-JP.resx | 8 ++++++++ .../LandingPage.lang-pl-PL.resx | 8 ++++++++ .../LandingPage.lang-ru-RU.resx | 8 ++++++++ .../LandingPage.lang-sv-SE.resx | 8 ++++++++ .../LandingPage.lang-zh-CN.resx | 8 ++++++++ 9 files changed, 72 insertions(+) diff --git a/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx index 40392a75..d3c64737 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx @@ -51,4 +51,12 @@ Du har {0} godkendelsesforsøg afventende. Klik her for at se dem. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx index 8bc82c85..17c09a1d 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-eo-UY.resx @@ -51,4 +51,12 @@ Vi havas {0} pritraktatajn aŭtentigajn provojn. Klaku ĉi tie por vidi ilin. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx index 44dd3f75..874ee983 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-es-MX.resx @@ -51,4 +51,12 @@ Tiene {0} intentos de autenticación pendientes. Haga clic aquí para verlos. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx b/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx index 86c33871..ed7772d2 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-fil-PH.resx @@ -51,4 +51,12 @@ You have {0} authentication attempts pending. Click here to view them. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx index 99bacf7e..15179509 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx @@ -51,4 +51,12 @@ {0} の認証が保留中です。ここをクリックして確認してください。 A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx index 25736bd6..3ec4379d 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-pl-PL.resx @@ -51,4 +51,12 @@ Masz {0} oczekujących prób autoryzacji. Kliknij tutaj, by je zobaczyć. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx index 0361beff..0bebca43 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx @@ -51,4 +51,12 @@ У вас есть {0} попыток аутентификации в ожидании. Нажмите здесь, чтобы просмотреть их. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx index 86c33871..ed7772d2 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx @@ -51,4 +51,12 @@ You have {0} authentication attempts pending. Click here to view them. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx b/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx index 86c33871..ed7772d2 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-zh-CN.resx @@ -51,4 +51,12 @@ You have {0} authentication attempts pending. Click here to view them. A greeting on the main page of the website. + + + Newest Levels + + + + Latest Team Picks + \ No newline at end of file From 443b285253c376b2b00cce6910ce4e93ef22cc90 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 17:01:48 -0400 Subject: [PATCH 57/69] Translate login and logout pages --- ProjectLighthouse.Localization/General.resx | 39 +++++++++++++++++++ .../LocalizationManager.cs | 14 ++++++- ProjectLighthouse.Localization/LoggedOut.resx | 30 ++++++++++++++ .../ProjectLighthouse.Localization.csproj | 8 ++++ .../StringLists/GeneralStrings.cs | 13 +++++++ .../StringLists/LoggedOutStrings.cs | 10 +++++ .../TranslationAreas.cs | 2 + .../Pages/LoginForm.cshtml | 19 ++++----- .../Pages/LogoutPage.cshtml | 10 ++++- 9 files changed, 132 insertions(+), 13 deletions(-) create mode 100644 ProjectLighthouse.Localization/General.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.resx create mode 100644 ProjectLighthouse.Localization/StringLists/GeneralStrings.cs create mode 100644 ProjectLighthouse.Localization/StringLists/LoggedOutStrings.cs diff --git a/ProjectLighthouse.Localization/General.resx b/ProjectLighthouse.Localization/General.resx new file mode 100644 index 00000000..2e014ac5 --- /dev/null +++ b/ProjectLighthouse.Localization/General.resx @@ -0,0 +1,39 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 6f63cf8a..ef4a6358 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -26,9 +26,19 @@ public static class LocalizationManager // e.g. BaseLayout.resx as opposed to BaseLayout.lang-da-DK.resx. if (language != DefaultLang) resourceBasename += $".lang-{language}"; - ResourceManager resourceManager = new(resourceBasename, Assembly.GetExecutingAssembly()); + string? localizedString = null; + try + { + ResourceManager resourceManager = new(resourceBasename, + Assembly.GetExecutingAssembly()); - string? localizedString = resourceManager.GetString(key); + localizedString = resourceManager.GetString(key); + } + catch + { + // ignored + } + if (localizedString == null) { #if DEBUG diff --git a/ProjectLighthouse.Localization/LoggedOut.resx b/ProjectLighthouse.Localization/LoggedOut.resx new file mode 100644 index 00000000..2d555c7e --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.resx @@ -0,0 +1,30 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj b/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj index f6397a51..57dfbc18 100644 --- a/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj +++ b/ProjectLighthouse.Localization/ProjectLighthouse.Localization.csproj @@ -13,6 +13,14 @@ ResXFileCodeGenerator LandingPage.Designer.cs + + ResXFileCodeGenerator + General.Designer.cs + + + ResXFileCodeGenerator + LoggedOut.Designer.cs + diff --git a/ProjectLighthouse.Localization/StringLists/GeneralStrings.cs b/ProjectLighthouse.Localization/StringLists/GeneralStrings.cs new file mode 100644 index 00000000..db134368 --- /dev/null +++ b/ProjectLighthouse.Localization/StringLists/GeneralStrings.cs @@ -0,0 +1,13 @@ +namespace LBPUnion.ProjectLighthouse.Localization.StringLists; + +public static class GeneralStrings +{ + public static readonly TranslatableString Username = create("username"); + public static readonly TranslatableString Password = create("password"); + public static readonly TranslatableString Register = create("register"); + public static readonly TranslatableString ForgotPassword = create("forgot_password"); + public static readonly TranslatableString Error = create("error"); + public static readonly TranslatableString LogIn = create("log_in"); + + private static TranslatableString create(string key) => new(TranslationAreas.General, key); +} \ No newline at end of file diff --git a/ProjectLighthouse.Localization/StringLists/LoggedOutStrings.cs b/ProjectLighthouse.Localization/StringLists/LoggedOutStrings.cs new file mode 100644 index 00000000..e8ae3bb9 --- /dev/null +++ b/ProjectLighthouse.Localization/StringLists/LoggedOutStrings.cs @@ -0,0 +1,10 @@ +namespace LBPUnion.ProjectLighthouse.Localization.StringLists; + +public static class LoggedOutStrings +{ + public static readonly TranslatableString LoggedOut = create("logged_out"); + public static readonly TranslatableString LoggedOutInfo = create("logged_out_info"); + public static readonly TranslatableString Redirect = create("redirect"); + + private static TranslatableString create(string key) => new(TranslationAreas.LoggedOut, key); +} \ No newline at end of file diff --git a/ProjectLighthouse.Localization/TranslationAreas.cs b/ProjectLighthouse.Localization/TranslationAreas.cs index 0a4523ee..ae90be13 100644 --- a/ProjectLighthouse.Localization/TranslationAreas.cs +++ b/ProjectLighthouse.Localization/TranslationAreas.cs @@ -4,4 +4,6 @@ public enum TranslationAreas { BaseLayout, LandingPage, + General, + LoggedOut, } \ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/LoginForm.cshtml b/ProjectLighthouse.Servers.Website/Pages/LoginForm.cshtml index fbebba49..cedbbdc7 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LoginForm.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LoginForm.cshtml @@ -1,10 +1,11 @@ @page "/login" @using LBPUnion.ProjectLighthouse.Configuration +@using LBPUnion.ProjectLighthouse.Localization.StringLists @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.LoginForm @{ Layout = "Layouts/BaseLayout"; - Model.Title = "Log in"; + Model.Title = Model.Translate(GeneralStrings.LogIn); } @@ -29,7 +30,7 @@ {
- Uh oh! + @Model.Translate(GeneralStrings.Error)

@Model.Error

@@ -40,17 +41,17 @@
- +
- +
- +
- +
@@ -62,13 +63,13 @@ }
- + @if (ServerConfiguration.Instance.Authentication.RegistrationEnabled) {
- Register + @Model.Translate(GeneralStrings.Register)
} @@ -76,7 +77,7 @@
- Forgot Password? + @Model.Translate(GeneralStrings.ForgotPassword)
\ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/LogoutPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LogoutPage.cshtml index 62f902c1..8854bcb0 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LogoutPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LogoutPage.cshtml @@ -1,10 +1,16 @@ @page "/logout" +@using LBPUnion.ProjectLighthouse.Localization.StringLists @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.LogoutPage @{ Layout = "Layouts/BaseLayout"; - Model.Title = "Logged out"; + Model.Title = Model.Translate(LoggedOutStrings.LoggedOut); } -

You have been successfully logged out. You will be redirected in 5 seconds, or you may click here to do so manually.

+

@Model.Translate(LoggedOutStrings.LoggedOutInfo)

+ + + @Model.Translate(LoggedOutStrings.Redirect) + + \ No newline at end of file From 02d8e4db34374a789e9f4fd562997200bf7f9455 Mon Sep 17 00:00:00 2001 From: Jayden Date: Tue, 26 Jul 2022 17:03:05 -0400 Subject: [PATCH 58/69] New Crowdin updates (#56) * New translations LandingPage.resx (Irish) * New translations LandingPage.resx (Arabic) * New translations LandingPage.resx (French) * New translations BaseLayout.resx (Scottish Gaelic) * New translations BaseLayout.resx (Irish) * New translations BaseLayout.resx (Arabic) * New translations BaseLayout.resx (French) * New translations LandingPage.resx (Swedish) * New translations BaseLayout.resx (Swedish) * New translations LandingPage.resx (Scottish Gaelic) --- .../BaseLayout.lang-ar-SA.resx | 66 +++++++++++++++++++ .../BaseLayout.lang-fr-FR.resx | 66 +++++++++++++++++++ .../BaseLayout.lang-ga-IE.resx | 66 +++++++++++++++++++ .../BaseLayout.lang-gd-GB.resx | 66 +++++++++++++++++++ .../BaseLayout.lang-sv-SE.resx | 10 +-- .../LandingPage.lang-ar-SA.resx | 62 +++++++++++++++++ .../LandingPage.lang-fr-FR.resx | 62 +++++++++++++++++ .../LandingPage.lang-ga-IE.resx | 62 +++++++++++++++++ .../LandingPage.lang-gd-GB.resx | 62 +++++++++++++++++ .../LandingPage.lang-sv-SE.resx | 16 ++--- 10 files changed, 525 insertions(+), 13 deletions(-) create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-gd-GB.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-ar-SA.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-fr-FR.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-ga-IE.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-gd-GB.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx b/ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-gd-GB.resx b/ProjectLighthouse.Localization/BaseLayout.lang-gd-GB.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-gd-GB.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx index b9ee410a..ee6f8508 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx @@ -43,24 +43,24 @@ - Authentication + Autentisering A button on the header that takes you to a list of authentication attempts. - Login / Register + Logga in / Registrera A button on the header that lets you log in or register. - Profile + Min Profil A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + Administrationspanel A header link that takes you to the admin panel if available. - Log out + Logga ut A shortcut to log you out of your account. \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ar-SA.resx b/ProjectLighthouse.Localization/LandingPage.lang-ar-SA.resx new file mode 100644 index 00000000..ed7772d2 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-ar-SA.resx @@ -0,0 +1,62 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to {0}! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + + + Newest Levels + + + + Latest Team Picks + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-fr-FR.resx b/ProjectLighthouse.Localization/LandingPage.lang-fr-FR.resx new file mode 100644 index 00000000..ed7772d2 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-fr-FR.resx @@ -0,0 +1,62 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to {0}! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + + + Newest Levels + + + + Latest Team Picks + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ga-IE.resx b/ProjectLighthouse.Localization/LandingPage.lang-ga-IE.resx new file mode 100644 index 00000000..ed7772d2 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-ga-IE.resx @@ -0,0 +1,62 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to {0}! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + + + Newest Levels + + + + Latest Team Picks + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-gd-GB.resx b/ProjectLighthouse.Localization/LandingPage.lang-gd-GB.resx new file mode 100644 index 00000000..ed7772d2 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-gd-GB.resx @@ -0,0 +1,62 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to {0}! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + + + Newest Levels + + + + Latest Team Picks + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx index ed7772d2..ca1cae9d 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-sv-SE.resx @@ -23,40 +23,40 @@ - Welcome to {0}! + Välkommen till {0}! A greeting on the main page of the website. - You are currently logged in as {0}. + Du är inloggad som {0}. A greeting on the main page of the website. - There are no users online. Why not hop on? + Ingen är online. Dags att gibba? A greeting on the main page of the website. - There is 1 user currently online: + 1 användare är online: A greeting on the main page of the website. - There are currently {0} users online: + {0} användare är online: A greeting on the main page of the website. - You have {0} authentication attempts pending. Click here to view them. + {0} autentiseringsförsök väntar. Klicka här för att visa dem. A greeting on the main page of the website. - Newest Levels + Senaste Banor - Latest Team Picks + Senaste Team Picks \ No newline at end of file From 7185461b561055e92fc85bb34c8516ebadaa8169 Mon Sep 17 00:00:00 2001 From: Jayden Date: Tue, 26 Jul 2022 17:11:21 -0400 Subject: [PATCH 59/69] New Crowdin updates (#57) * New translations LoggedOut.resx (French) * New translations General.resx (Irish) * New translations General.resx (Japanese) * New translations General.resx (Polish) * New translations General.resx (Russian) * New translations General.resx (Swedish) * New translations General.resx (Chinese Simplified) * New translations General.resx (Spanish, Mexico) * New translations General.resx (Esperanto) * New translations General.resx (Filipino) * New translations LoggedOut.resx (Arabic) * New translations General.resx (Arabic) * New translations LoggedOut.resx (Danish) * New translations LoggedOut.resx (Irish) * New translations LoggedOut.resx (Japanese) * New translations LoggedOut.resx (Polish) * New translations LoggedOut.resx (Russian) * New translations LoggedOut.resx (Swedish) * New translations LoggedOut.resx (Chinese Simplified) * New translations LoggedOut.resx (Spanish, Mexico) * New translations LoggedOut.resx (Esperanto) * New translations General.resx (Danish) * New translations General.resx (French) * New translations LoggedOut.resx (Filipino) --- .../General.lang-ar-SA.resx | 38 +++++++++++++++++++ .../General.lang-da-DK.resx | 38 +++++++++++++++++++ .../General.lang-eo-UY.resx | 38 +++++++++++++++++++ .../General.lang-es-MX.resx | 38 +++++++++++++++++++ .../General.lang-fil-PH.resx | 38 +++++++++++++++++++ .../General.lang-fr-FR.resx | 38 +++++++++++++++++++ .../General.lang-ga-IE.resx | 38 +++++++++++++++++++ .../General.lang-ja-JP.resx | 38 +++++++++++++++++++ .../General.lang-pl-PL.resx | 38 +++++++++++++++++++ .../General.lang-ru-RU.resx | 38 +++++++++++++++++++ .../General.lang-sv-SE.resx | 38 +++++++++++++++++++ .../General.lang-zh-CN.resx | 38 +++++++++++++++++++ .../LoggedOut.lang-ar-SA.resx | 29 ++++++++++++++ .../LoggedOut.lang-da-DK.resx | 29 ++++++++++++++ .../LoggedOut.lang-eo-UY.resx | 29 ++++++++++++++ .../LoggedOut.lang-es-MX.resx | 29 ++++++++++++++ .../LoggedOut.lang-fil-PH.resx | 29 ++++++++++++++ .../LoggedOut.lang-fr-FR.resx | 29 ++++++++++++++ .../LoggedOut.lang-ga-IE.resx | 29 ++++++++++++++ .../LoggedOut.lang-ja-JP.resx | 29 ++++++++++++++ .../LoggedOut.lang-pl-PL.resx | 29 ++++++++++++++ .../LoggedOut.lang-ru-RU.resx | 29 ++++++++++++++ .../LoggedOut.lang-sv-SE.resx | 29 ++++++++++++++ .../LoggedOut.lang-zh-CN.resx | 29 ++++++++++++++ 24 files changed, 804 insertions(+) create mode 100644 ProjectLighthouse.Localization/General.lang-ar-SA.resx create mode 100644 ProjectLighthouse.Localization/General.lang-da-DK.resx create mode 100644 ProjectLighthouse.Localization/General.lang-eo-UY.resx create mode 100644 ProjectLighthouse.Localization/General.lang-es-MX.resx create mode 100644 ProjectLighthouse.Localization/General.lang-fil-PH.resx create mode 100644 ProjectLighthouse.Localization/General.lang-fr-FR.resx create mode 100644 ProjectLighthouse.Localization/General.lang-ga-IE.resx create mode 100644 ProjectLighthouse.Localization/General.lang-ja-JP.resx create mode 100644 ProjectLighthouse.Localization/General.lang-pl-PL.resx create mode 100644 ProjectLighthouse.Localization/General.lang-ru-RU.resx create mode 100644 ProjectLighthouse.Localization/General.lang-sv-SE.resx create mode 100644 ProjectLighthouse.Localization/General.lang-zh-CN.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-ar-SA.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-eo-UY.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-es-MX.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-fil-PH.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-fr-FR.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-ga-IE.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-pl-PL.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-zh-CN.resx diff --git a/ProjectLighthouse.Localization/General.lang-ar-SA.resx b/ProjectLighthouse.Localization/General.lang-ar-SA.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-ar-SA.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-da-DK.resx b/ProjectLighthouse.Localization/General.lang-da-DK.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-da-DK.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-eo-UY.resx b/ProjectLighthouse.Localization/General.lang-eo-UY.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-eo-UY.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-es-MX.resx b/ProjectLighthouse.Localization/General.lang-es-MX.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-es-MX.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-fil-PH.resx b/ProjectLighthouse.Localization/General.lang-fil-PH.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-fil-PH.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-fr-FR.resx b/ProjectLighthouse.Localization/General.lang-fr-FR.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-fr-FR.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-ga-IE.resx b/ProjectLighthouse.Localization/General.lang-ga-IE.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-ga-IE.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-ja-JP.resx b/ProjectLighthouse.Localization/General.lang-ja-JP.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-ja-JP.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-pl-PL.resx b/ProjectLighthouse.Localization/General.lang-pl-PL.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-pl-PL.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-ru-RU.resx b/ProjectLighthouse.Localization/General.lang-ru-RU.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-ru-RU.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-sv-SE.resx b/ProjectLighthouse.Localization/General.lang-sv-SE.resx new file mode 100644 index 00000000..3c2b250f --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-sv-SE.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Användarnamn + + + Lösenord + + + Registrera + + + Glömt lösenordet? + + + Ajdå! + + + Logga in + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-zh-CN.resx b/ProjectLighthouse.Localization/General.lang-zh-CN.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-zh-CN.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-ar-SA.resx b/ProjectLighthouse.Localization/LoggedOut.lang-ar-SA.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-ar-SA.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx b/ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-eo-UY.resx b/ProjectLighthouse.Localization/LoggedOut.lang-eo-UY.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-eo-UY.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-es-MX.resx b/ProjectLighthouse.Localization/LoggedOut.lang-es-MX.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-es-MX.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-fil-PH.resx b/ProjectLighthouse.Localization/LoggedOut.lang-fil-PH.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-fil-PH.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-fr-FR.resx b/ProjectLighthouse.Localization/LoggedOut.lang-fr-FR.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-fr-FR.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-ga-IE.resx b/ProjectLighthouse.Localization/LoggedOut.lang-ga-IE.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-ga-IE.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx b/ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-pl-PL.resx b/ProjectLighthouse.Localization/LoggedOut.lang-pl-PL.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-pl-PL.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx b/ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx b/ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx new file mode 100644 index 00000000..0b19fb61 --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Utloggad + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Omdirigera + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-zh-CN.resx b/ProjectLighthouse.Localization/LoggedOut.lang-zh-CN.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-zh-CN.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file From b4348b44104674205f6410e01de8eafc95ad3559 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 17:13:20 -0400 Subject: [PATCH 60/69] Don't force language --- .../Pages/Layouts/BaseLayout.cshtml.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs index c8c8e882..00a15e2a 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs @@ -47,7 +47,6 @@ public class BaseLayout : PageModel private string getLanguage() { - return "da-DK"; IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get(); if (requestCulture == null) return LocalizationManager.DefaultLang; From 866c7a3de10290eeca041cecadcebdcc1bbbd059 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 17:46:20 -0400 Subject: [PATCH 61/69] Update Translations --- ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx b/ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx index 0b19fb61..50daa5ee 100644 --- a/ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/LoggedOut.lang-sv-SE.resx @@ -21,7 +21,7 @@ Utloggad - You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + Du har loggat ut. Om 5 sekunder kommer du bli omderigerad, eller kan du klicka på knappen under, manuellt. Omdirigera From 7b1c8d4591165c34f73cde2fb882b971a5e76782 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 17:58:57 -0400 Subject: [PATCH 62/69] Fix default lang causing problems --- ProjectLighthouse.Localization/LocalizationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index ef4a6358..6c838f17 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -7,7 +7,7 @@ namespace LBPUnion.ProjectLighthouse.Localization; public static class LocalizationManager { private static readonly string namespaceStr = typeof(LocalizationManager).Namespace ?? ""; - public const string DefaultLang = "ja-JP"; + public const string DefaultLang = "en-US"; public static string GetLocalizedString(TranslationAreas translationArea, string language, string key) { From 40b3ebdc6cea1f0f79e2baf96983ef5c556f8f16 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 18:16:14 -0400 Subject: [PATCH 63/69] Fix languages not changing --- .../Startup/WebsiteStartup.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs b/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs index 900e31ce..f1f80025 100644 --- a/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs +++ b/ProjectLighthouse.Servers.Website/Startup/WebsiteStartup.cs @@ -1,5 +1,8 @@ +using System.Globalization; +using LBPUnion.ProjectLighthouse.Localization; using LBPUnion.ProjectLighthouse.Middlewares; using Microsoft.AspNetCore.HttpOverrides; +using Microsoft.AspNetCore.Localization; #if !DEBUG using Microsoft.Extensions.Hosting.Internal; @@ -38,6 +41,16 @@ public class WebsiteStartup } ); + services.Configure(config => + { + List languages = LocalizationManager.GetAvailableLanguages().Select(l => new CultureInfo(LocalizationManager.MapLanguage(l))).ToList(); + + config.DefaultRequestCulture = new RequestCulture(new CultureInfo("en-US")); + + config.SupportedCultures = languages; + config.SupportedUICultures = languages; + }); + #if DEBUG services.AddSingleton(); #else From 27663c05547f86cdff89fd008ef4f8998d6c8169 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 18:46:13 -0400 Subject: [PATCH 64/69] Update Danish, Japanese, and Chinese translations, add Norweigan translations --- .../BaseLayout.lang-no-NO.resx | 66 +++++++++++++++++++ .../BaseLayout.lang-pt-PT.resx | 66 +++++++++++++++++++ .../General.lang-da-DK.resx | 12 ++-- .../General.lang-ja-JP.resx | 12 ++-- .../General.lang-no-NO.resx | 38 +++++++++++ .../General.lang-pt-PT.resx | 38 +++++++++++ .../General.lang-zh-CN.resx | 8 +-- .../LandingPage.lang-da-DK.resx | 6 +- .../LandingPage.lang-ja-JP.resx | 12 ++-- .../LandingPage.lang-no-NO.resx | 62 +++++++++++++++++ .../LandingPage.lang-pt-PT.resx | 62 +++++++++++++++++ .../LoggedOut.lang-da-DK.resx | 6 +- .../LoggedOut.lang-ja-JP.resx | 6 +- .../LoggedOut.lang-no-NO.resx | 29 ++++++++ .../LoggedOut.lang-pt-PT.resx | 29 ++++++++ 15 files changed, 421 insertions(+), 31 deletions(-) create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx create mode 100644 ProjectLighthouse.Localization/General.lang-no-NO.resx create mode 100644 ProjectLighthouse.Localization/General.lang-pt-PT.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-no-NO.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-no-NO.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx b/ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx new file mode 100644 index 00000000..aef7314b --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Hjem + A button on the header that takes you to the landing page. + + + + Brukere + A button on the header that takes you to the user listing. + + + + Bilder + A button on the header that takes you to a list of user-uploaded photos. + + + + Nivåer + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Godkjenning + A button on the header that takes you to a list of authentication attempts. + + + + Logg inn/Registrer + A button on the header that lets you log in or register. + + + Profil + A quick shortcut on the header to take you to your profile if logged in. + + + Administrasjon + A header link that takes you to the admin panel if available. + + + Logg ut + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-da-DK.resx b/ProjectLighthouse.Localization/General.lang-da-DK.resx index b3c93d7c..6db48d85 100644 --- a/ProjectLighthouse.Localization/General.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/General.lang-da-DK.resx @@ -18,21 +18,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Username + Brugernavn - Password + Adgangskode - Register + Registrer - Forgot Password? + Glemt adgangskode? - Uh oh! + Åh nej! - Log In + Log ind \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-ja-JP.resx b/ProjectLighthouse.Localization/General.lang-ja-JP.resx index b3c93d7c..247008f3 100644 --- a/ProjectLighthouse.Localization/General.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/General.lang-ja-JP.resx @@ -18,21 +18,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Username + ユーザーネーム - Password + パスワード - Register + 登録する - Forgot Password? + パスワードを忘れましたか? - Uh oh! + おおっと! - Log In + ログイン \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-no-NO.resx b/ProjectLighthouse.Localization/General.lang-no-NO.resx new file mode 100644 index 00000000..eb66dc58 --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-no-NO.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Brukernavn + + + Passord + + + Registrer + + + Glemt Passord? + + + Ånei! + + + Logg in + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-pt-PT.resx b/ProjectLighthouse.Localization/General.lang-pt-PT.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-pt-PT.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-zh-CN.resx b/ProjectLighthouse.Localization/General.lang-zh-CN.resx index b3c93d7c..f2ff702f 100644 --- a/ProjectLighthouse.Localization/General.lang-zh-CN.resx +++ b/ProjectLighthouse.Localization/General.lang-zh-CN.resx @@ -18,7 +18,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Username + 用户名 Password @@ -27,12 +27,12 @@ Register - Forgot Password? + 忘记密码? - Uh oh! + 哎呀! - Log In + 登入 \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx index d3c64737..160394c2 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-da-DK.resx @@ -23,7 +23,7 @@ - Welcome to {0}! + Velkommen til {0}! A greeting on the main page of the website. @@ -53,10 +53,10 @@ - Newest Levels + Seneste Baner - Latest Team Picks + Seneste Team Picks \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx index 15179509..3611578d 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ja-JP.resx @@ -23,7 +23,7 @@ - Welcome to {0}! + {0}へようこそ A greeting on the main page of the website. @@ -33,17 +33,17 @@ - オンラインユーザーなし + オンラインユーザーはなし A greeting on the main page of the website. - 1つのユーザーがオンライン + 1人のユーザーがオンライン A greeting on the main page of the website. - {0}つのユーザーがオンライン + {0}人のユーザーがオンライン A greeting on the main page of the website. @@ -53,10 +53,10 @@ - Newest Levels + 最新のレベル - Latest Team Picks + 最新のチームピック \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-no-NO.resx b/ProjectLighthouse.Localization/LandingPage.lang-no-NO.resx new file mode 100644 index 00000000..bb049a4d --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-no-NO.resx @@ -0,0 +1,62 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Velkommen til {0} + A greeting on the main page of the website. + + + + Du er logget inn som {0} + A greeting on the main page of the website. + + + + Det er ingen brukere på. Hvorfor ikke hoppe på? + A greeting on the main page of the website. + + + + Det er 1 bruker på for øyeblikket: + A greeting on the main page of the website. + + + + For tiden er {0} brukere pålogget: + A greeting on the main page of the website. + + + + Du har {0} autentiseringsforsøk. Klikk her for å se dem. + A greeting on the main page of the website. + + + + Nyeste nivåer + + + + Siste lag valg + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx b/ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx new file mode 100644 index 00000000..ed7772d2 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx @@ -0,0 +1,62 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to {0}! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + + + Newest Levels + + + + Latest Team Picks + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx b/ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx index 9f53122d..2c1315cd 100644 --- a/ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/LoggedOut.lang-da-DK.resx @@ -18,12 +18,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Logged Out + Logget ud - You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + Du er blevet logget ud. Du vil blive omdirigeret om 5 sekunder, eller du kan klikke nedenfor for at gøre det manuelt. - Redirect + Omdiriger \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx b/ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx index 9f53122d..09810770 100644 --- a/ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/LoggedOut.lang-ja-JP.resx @@ -18,12 +18,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Logged Out + ログアウトしました - You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + 正常にログアウトされました。5秒後にリダイレクトされるか、以下をクリックして手動でログアウトできます。 - Redirect + リダイレクト \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-no-NO.resx b/ProjectLighthouse.Localization/LoggedOut.lang-no-NO.resx new file mode 100644 index 00000000..a33eb4e2 --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-no-NO.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logget ut + + + Du har blitt logget ut. Du vil bli omdirigert om 5 sekunder, eller du kan klikke nedenfor for å gjøre det manuelt. + + + Videresend + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx b/ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file From 2dcf8dd39077b67b77315356551830b9bb712a7c Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 19:20:57 -0400 Subject: [PATCH 65/69] Fix unit test failures --- .../Pages/Layouts/BaseLayout.cshtml.cs | 3 +++ .../Tests/AuthenticationTests.cs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs index 00a15e2a..3537e4cb 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml.cs @@ -1,6 +1,7 @@ #nullable enable using System; using System.Collections.Generic; +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Localization; using LBPUnion.ProjectLighthouse.Localization.StringLists; using LBPUnion.ProjectLighthouse.PlayerData.Profiles; @@ -47,6 +48,8 @@ public class BaseLayout : PageModel private string getLanguage() { + if (ServerStatics.IsUnitTesting) return "en-US"; + IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get(); if (requestCulture == null) return LocalizationManager.DefaultLang; diff --git a/ProjectLighthouse.Tests.WebsiteTests/Tests/AuthenticationTests.cs b/ProjectLighthouse.Tests.WebsiteTests/Tests/AuthenticationTests.cs index 35a20bb4..af4c9af2 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/Tests/AuthenticationTests.cs +++ b/ProjectLighthouse.Tests.WebsiteTests/Tests/AuthenticationTests.cs @@ -78,7 +78,7 @@ public class AuthenticationTests : LighthouseWebTest [DatabaseFact] public async Task ShouldLoginWithInjectedCookie() { - const string loggedInAsUsernameTextXPath = "/html/body/div/div/div/p[1]/b"; + const string loggedInAsUsernameTextXPath = "/html/body/div/div/div/p[1]"; await using Database database = new(); Random random = new(); @@ -96,10 +96,10 @@ public class AuthenticationTests : LighthouseWebTest INavigation navigation = this.Driver.Navigate(); navigation.GoToUrl(this.BaseAddress + "/"); + Assert.DoesNotContain(user.Username, this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text); this.Driver.Manage().Cookies.AddCookie(new Cookie("LighthouseToken", webToken.UserToken)); - Assert.Throws(() => this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath))); navigation.Refresh(); - Assert.True(this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text == user.Username); + Assert.Contains(user.Username, this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text); await database.RemoveUser(user); } From 6ca81e042198ce0ba04a3d692b3bee7d2cccda31 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 27 Jul 2022 00:11:15 -0400 Subject: [PATCH 66/69] Add grief report webhook, add ability to link to individual reports --- .../Controllers/ReportController.cs | 8 + .../Partials/RenderReportBoundsPartial.cshtml | 147 +++++++++++++ .../Pages/Partials/ReportPartial.cshtml | 63 ++++++ .../Pages/ReportPage.cshtml | 18 ++ .../Pages/ReportPage.cshtml.cs | 42 ++++ .../Pages/ReportsPage.cshtml | 208 +----------------- .../DiscordIntegrationConfiguration.cs | 2 + .../Configuration/ServerConfiguration.cs | 2 +- ProjectLighthouse/Helpers/WebhookHelper.cs | 39 +++- 9 files changed, 317 insertions(+), 212 deletions(-) create mode 100644 ProjectLighthouse.Servers.Website/Pages/Partials/RenderReportBoundsPartial.cshtml create mode 100644 ProjectLighthouse.Servers.Website/Pages/Partials/ReportPartial.cshtml create mode 100644 ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml create mode 100644 ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml.cs diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs index 0b39c355..9883a7d7 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs @@ -2,6 +2,7 @@ using System.Text.Json; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Administration.Reports; +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Types; @@ -45,6 +46,13 @@ public class ReportController : ControllerBase this.database.Reports.Add(report); await this.database.SaveChangesAsync(); + await WebhookHelper.SendWebhook( + title: "New grief report", + description: $"Submitted by {user.Username}\n" + + $"To view it, click [here]({ServerConfiguration.Instance.ExternalUrl}/admin/report/{report.ReportId}).", + dest: WebhookHelper.WebhookDestination.Moderation + ); + return this.Ok(); } diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/RenderReportBoundsPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/RenderReportBoundsPartial.cshtml new file mode 100644 index 00000000..19387632 --- /dev/null +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/RenderReportBoundsPartial.cshtml @@ -0,0 +1,147 @@ + \ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/ReportPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/ReportPartial.cshtml new file mode 100644 index 00000000..7059919e --- /dev/null +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/ReportPartial.cshtml @@ -0,0 +1,63 @@ +@using LBPUnion.ProjectLighthouse.Administration.Reports +@model LBPUnion.ProjectLighthouse.Administration.Reports.GriefReport + +
+
+ + + Grief report picture +
+

+ + Report submitted by + + @Model.ReportingPlayer.Username + + +

+ Report contains @Model.XmlPlayers.Length @(Model.XmlPlayers.Length == 1 ? "player" : "players") + @foreach (ReportPlayer player in Model.XmlPlayers) + { + + } + +
+
+ Report time: @(DateTimeOffset.FromUnixTimeMilliseconds(Model.Timestamp).ToString("R")) +
+
+ Report reason: @Model.Type +
+
+ Level ID: @Model.LevelId +
+
+ Level type: @Model.LevelType +
+
+ Level owner: @Model.LevelOwner +
+
+ + + + Dismiss + + + + Remove all related assets + +
+ + diff --git a/ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml new file mode 100644 index 00000000..738d1dd1 --- /dev/null +++ b/ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml @@ -0,0 +1,18 @@ +@page "/admin/report/{reportId:int}" +@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.ReportPage + +@{ + Layout = "Layouts/BaseLayout"; + Model.Title = $"Report {Model.Report.ReportId}"; +} + + + +@await Html.PartialAsync("Partials/ReportPartial", Model.Report) +@await Html.PartialAsync("Partials/RenderReportBoundsPartial") \ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml.cs new file mode 100644 index 00000000..20f5cb4f --- /dev/null +++ b/ProjectLighthouse.Servers.Website/Pages/ReportPage.cshtml.cs @@ -0,0 +1,42 @@ +using System.Text.Json; +using LBPUnion.ProjectLighthouse.Administration.Reports; +using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.EntityFrameworkCore; + +namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages; + +public class ReportPage : BaseLayout +{ + public ReportPage(Database database) : base(database) + {} + + public GriefReport Report; + + public async Task OnGet([FromRoute] int reportId) + { + User? user = this.Database.UserFromWebRequest(this.Request); + if (user == null) return this.Redirect("~/login"); + if (!user.IsAdmin) return this.NotFound(); + + GriefReport? report = await this.Database.Reports + .Include(r => r.ReportingPlayer) + .FirstOrDefaultAsync(r => r.ReportId == reportId); + if (report == null) return this.NotFound(); + + report.XmlPlayers = (ReportPlayer[])JsonSerializer.Deserialize(report.Players, + typeof(ReportPlayer[]))!; + + report.XmlBounds = new Marqee + { + Rect = (Rectangle)JsonSerializer.Deserialize(report.Bounds, + typeof(Rectangle))!, + }; + + this.Report = report; + + return this.Page(); + } +} \ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/ReportsPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/ReportsPage.cshtml index c413b58a..8193a398 100644 --- a/ProjectLighthouse.Servers.Website/Pages/ReportsPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/ReportsPage.cshtml @@ -28,214 +28,10 @@ @foreach (GriefReport report in Model.Reports) { -
-
- - - Grief report picture -
-

- - Report submitted by - - @report.ReportingPlayer.Username - - -

- Report contains @report.XmlPlayers.Length @(report.XmlPlayers.Length == 1 ? "player" : "players") - @foreach (ReportPlayer player in report.XmlPlayers) - { - - } - -
-
- Report time: @(DateTimeOffset.FromUnixTimeMilliseconds(report.Timestamp).ToString("R")) -
-
- Report reason: @report.Type -
-
- Level ID: @report.LevelId -
-
- Level type: @report.LevelType -
-
- Level owner: @report.LevelOwner -
-
- - - - Dismiss - - - - Remove all related assets - -
- + @await Html.PartialAsync("Partials/ReportPartial", report) } - +@await Html.PartialAsync("Partials/RenderReportBoundsPartial") @if (Model.PageNumber != 0) { diff --git a/ProjectLighthouse/Configuration/ConfigurationCategories/DiscordIntegrationConfiguration.cs b/ProjectLighthouse/Configuration/ConfigurationCategories/DiscordIntegrationConfiguration.cs index 92246899..1454338d 100644 --- a/ProjectLighthouse/Configuration/ConfigurationCategories/DiscordIntegrationConfiguration.cs +++ b/ProjectLighthouse/Configuration/ConfigurationCategories/DiscordIntegrationConfiguration.cs @@ -8,4 +8,6 @@ public class DiscordIntegrationConfiguration public bool DiscordIntegrationEnabled { get; set; } public string Url { get; set; } = ""; + + public string ModerationUrl { get; set; } = ""; } \ No newline at end of file diff --git a/ProjectLighthouse/Configuration/ServerConfiguration.cs b/ProjectLighthouse/Configuration/ServerConfiguration.cs index 30c5ee41..41618860 100644 --- a/ProjectLighthouse/Configuration/ServerConfiguration.cs +++ b/ProjectLighthouse/Configuration/ServerConfiguration.cs @@ -23,7 +23,7 @@ public class ServerConfiguration // You can use an ObsoleteAttribute instead. Make sure you set it to error, though. // // Thanks for listening~ - public const int CurrentConfigVersion = 7; + public const int CurrentConfigVersion = 8; #region Meta diff --git a/ProjectLighthouse/Helpers/WebhookHelper.cs b/ProjectLighthouse/Helpers/WebhookHelper.cs index 031a79de..d54026c2 100644 --- a/ProjectLighthouse/Helpers/WebhookHelper.cs +++ b/ProjectLighthouse/Helpers/WebhookHelper.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using Discord; using Discord.Webhook; @@ -7,17 +8,44 @@ namespace LBPUnion.ProjectLighthouse.Helpers; public static class WebhookHelper { - private static readonly DiscordWebhookClient client = (ServerConfiguration.Instance.DiscordIntegration.DiscordIntegrationEnabled + /// + /// The destination of the webhook post. + /// + public enum WebhookDestination : byte + { + /// + /// A channel intended for public viewing; where new levels and photos are sent. + /// + Public, + /// + /// A channel intended for moderators; where grief reports are sent. + /// + Moderation, + } + + private static readonly DiscordWebhookClient publicClient = (ServerConfiguration.Instance.DiscordIntegration.DiscordIntegrationEnabled ? new DiscordWebhookClient(ServerConfiguration.Instance.DiscordIntegration.Url) : null); + private static readonly DiscordWebhookClient moderationClient = (ServerConfiguration.Instance.DiscordIntegration.DiscordIntegrationEnabled + ? new DiscordWebhookClient(ServerConfiguration.Instance.DiscordIntegration.ModerationUrl) + : null); + public static readonly Color UnionColor = new(0, 140, 255); - public static Task SendWebhook(EmbedBuilder builder) => SendWebhook(builder.Build()); + public static Task SendWebhook(EmbedBuilder builder, WebhookDestination dest = WebhookDestination.Public) + => SendWebhook(builder.Build(), dest); - public static async Task SendWebhook(Embed embed) + public static async Task SendWebhook(Embed embed, WebhookDestination dest = WebhookDestination.Public) { if (!ServerConfiguration.Instance.DiscordIntegration.DiscordIntegrationEnabled) return; + + DiscordWebhookClient client = dest switch + { + WebhookDestination.Public => publicClient, + WebhookDestination.Moderation => moderationClient, + _ => throw new ArgumentOutOfRangeException(nameof(dest), dest, null), + }; await client.SendMessageAsync ( @@ -28,7 +56,7 @@ public static class WebhookHelper ); } - public static Task SendWebhook(string title, string description) + public static Task SendWebhook(string title, string description, WebhookDestination dest = WebhookDestination.Public) => SendWebhook ( new EmbedBuilder @@ -36,6 +64,7 @@ public static class WebhookHelper Title = title, Description = description, Color = UnionColor, - } + }, + dest ); } \ No newline at end of file From f2b7f6cdf64ff23d15a192fe79ee6774c5d37a7c Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 27 Jul 2022 00:16:39 -0400 Subject: [PATCH 67/69] Update the localization files --- .../BaseLayout.lang-pt-PT.resx | 18 +++++++++--------- .../General.lang-pt-PT.resx | 12 ++++++------ .../General.lang-ru-RU.resx | 12 ++++++------ .../LandingPage.lang-pt-PT.resx | 16 ++++++++-------- .../LandingPage.lang-ru-RU.resx | 4 ++-- .../LoggedOut.lang-pt-PT.resx | 6 +++--- .../LoggedOut.lang-ru-RU.resx | 6 +++--- 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx index c799594c..80baf315 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx @@ -23,44 +23,44 @@ - Home + Início A button on the header that takes you to the landing page. - Users + Utilizadores A button on the header that takes you to the user listing. - Photos + Fotografias A button on the header that takes you to a list of user-uploaded photos. - Levels + Níveis A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". - Authentication + Autenticação A button on the header that takes you to a list of authentication attempts. - Login / Register + Fazer login ou registrar-se A button on the header that lets you log in or register. - Profile + Perfil A quick shortcut on the header to take you to your profile if logged in. - Admin Panel + Painel do administrador A header link that takes you to the admin panel if available. - Log out + Fechar sessão A shortcut to log you out of your account. \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-pt-PT.resx b/ProjectLighthouse.Localization/General.lang-pt-PT.resx index b3c93d7c..261f6594 100644 --- a/ProjectLighthouse.Localization/General.lang-pt-PT.resx +++ b/ProjectLighthouse.Localization/General.lang-pt-PT.resx @@ -18,21 +18,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Username + Nome do utilizador - Password + Palavra-chave - Register + Cadastrar - Forgot Password? + Esqueceu a palavra-passe? - Uh oh! + Essa não! - Log In + Iniciar Sessão \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-ru-RU.resx b/ProjectLighthouse.Localization/General.lang-ru-RU.resx index b3c93d7c..90aeb7d2 100644 --- a/ProjectLighthouse.Localization/General.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/General.lang-ru-RU.resx @@ -18,21 +18,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Username + Имя пользователя - Password + Пароль - Register + Регистр - Forgot Password? + Забыли пароль? - Uh oh! + Упс! - Log In + Вход \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx b/ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx index ed7772d2..9e0b0918 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-pt-PT.resx @@ -23,40 +23,40 @@ - Welcome to {0}! + Bem-vindo ao {0}! A greeting on the main page of the website. - You are currently logged in as {0}. + Você está logado como {0}. A greeting on the main page of the website. - There are no users online. Why not hop on? + Não há utilizadores online. Por que não entrar? A greeting on the main page of the website. - There is 1 user currently online: + Há 1 utilizador online no momento: A greeting on the main page of the website. - There are currently {0} users online: + Atualmente, existem {0} utilizadores ‘ligado’: A greeting on the main page of the website. - You have {0} authentication attempts pending. Click here to view them. + Você tem {0} tentativas de acesso pendentes. Clique aqui para visualizá-las. A greeting on the main page of the website. - Newest Levels + Níveis novos - Latest Team Picks + Escolhas mais recentes da equipa \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx index 0bebca43..2bb0e65e 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx @@ -23,7 +23,7 @@ - Welcome to {0}! + Добро пожаловать в {0} A greeting on the main page of the website. @@ -53,7 +53,7 @@ - Newest Levels + Новые уровни diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx b/ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx index 9f53122d..f125baa8 100644 --- a/ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx +++ b/ProjectLighthouse.Localization/LoggedOut.lang-pt-PT.resx @@ -18,12 +18,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Logged Out + Sessão encerrada - You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + Foi desconectado com sucesso. Será redirecionado em 5 segundos, ou pode clicar abaixo para fazê-lo manualmente. - Redirect + Redirecionar \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx b/ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx index 9f53122d..ba89348f 100644 --- a/ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/LoggedOut.lang-ru-RU.resx @@ -18,12 +18,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Logged Out + Выход - You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + Вы успешно вышли из системы. Вы будете перенаправлены через 5 секунд, или можете нажать ниже, чтобы сделать это вручную. - Redirect + Перенаправить \ No newline at end of file From 53dafe5f5380fef26a94b2200d156b97349a587a Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 27 Jul 2022 00:29:42 -0400 Subject: [PATCH 68/69] Fix languages with broken mappings --- .../LocalizationManager.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index 6c838f17..cb56dcd7 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -60,6 +60,21 @@ public static class LocalizationManager { "eo-UY", "eo" }, + { + "ru-RU", "ru" + }, + { + "pt-PT", "pt" + }, + { + "no-NO", "no" + }, + { + "pl-PL", "pl" + }, + { + "fr-FR", "fr" + }, }; /// From 4763a077ab3ce44a6ca5f5df13ce7e9dbc9fe1db Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 27 Jul 2022 00:31:45 -0400 Subject: [PATCH 69/69] Add german support, update russian translations --- .../BaseLayout.lang-de-DE.resx | 66 +++++++++++++++++++ .../General.lang-de-DE.resx | 38 +++++++++++ .../LandingPage.lang-de-DE.resx | 62 +++++++++++++++++ .../LandingPage.lang-ru-RU.resx | 2 +- .../LocalizationManager.cs | 3 + .../LoggedOut.lang-de-DE.resx | 29 ++++++++ 6 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx create mode 100644 ProjectLighthouse.Localization/General.lang-de-DE.resx create mode 100644 ProjectLighthouse.Localization/LandingPage.lang-de-DE.resx create mode 100644 ProjectLighthouse.Localization/LoggedOut.lang-de-DE.resx diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx new file mode 100644 index 00000000..c799594c --- /dev/null +++ b/ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx @@ -0,0 +1,66 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Home + A button on the header that takes you to the landing page. + + + + Users + A button on the header that takes you to the user listing. + + + + Photos + A button on the header that takes you to a list of user-uploaded photos. + + + + Levels + A button on the header that takes you to a list of user-uploaded levels. Levels are internally referred to as "slots". + + + + Authentication + A button on the header that takes you to a list of authentication attempts. + + + + Login / Register + A button on the header that lets you log in or register. + + + Profile + A quick shortcut on the header to take you to your profile if logged in. + + + Admin Panel + A header link that takes you to the admin panel if available. + + + Log out + A shortcut to log you out of your account. + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/General.lang-de-DE.resx b/ProjectLighthouse.Localization/General.lang-de-DE.resx new file mode 100644 index 00000000..b3c93d7c --- /dev/null +++ b/ProjectLighthouse.Localization/General.lang-de-DE.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Password + + + Register + + + Forgot Password? + + + Uh oh! + + + Log In + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-de-DE.resx b/ProjectLighthouse.Localization/LandingPage.lang-de-DE.resx new file mode 100644 index 00000000..ed7772d2 --- /dev/null +++ b/ProjectLighthouse.Localization/LandingPage.lang-de-DE.resx @@ -0,0 +1,62 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + + Welcome to {0}! + A greeting on the main page of the website. + + + + You are currently logged in as {0}. + A greeting on the main page of the website. + + + + There are no users online. Why not hop on? + A greeting on the main page of the website. + + + + There is 1 user currently online: + A greeting on the main page of the website. + + + + There are currently {0} users online: + A greeting on the main page of the website. + + + + You have {0} authentication attempts pending. Click here to view them. + A greeting on the main page of the website. + + + + Newest Levels + + + + Latest Team Picks + + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx index 2bb0e65e..f7628214 100644 --- a/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/LandingPage.lang-ru-RU.resx @@ -57,6 +57,6 @@ - Latest Team Picks + Последние избранное \ No newline at end of file diff --git a/ProjectLighthouse.Localization/LocalizationManager.cs b/ProjectLighthouse.Localization/LocalizationManager.cs index cb56dcd7..ba24ae58 100644 --- a/ProjectLighthouse.Localization/LocalizationManager.cs +++ b/ProjectLighthouse.Localization/LocalizationManager.cs @@ -75,6 +75,9 @@ public static class LocalizationManager { "fr-FR", "fr" }, + { + "de-DE", "de" + } }; /// diff --git a/ProjectLighthouse.Localization/LoggedOut.lang-de-DE.resx b/ProjectLighthouse.Localization/LoggedOut.lang-de-DE.resx new file mode 100644 index 00000000..9f53122d --- /dev/null +++ b/ProjectLighthouse.Localization/LoggedOut.lang-de-DE.resx @@ -0,0 +1,29 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logged Out + + + You have been successfully logged out. You will be redirected in 5 seconds, or you may click below to do so manually. + + + Redirect + + \ No newline at end of file