[PR #269] [MERGED] Optimizing language codes #1101

Closed
opened 2026-02-26 09:33:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NickeManarin/ScreenToGif/pull/269
Author: @spietras
Created: 2/12/2018
Status: Merged
Merged: 2/13/2018
Merged by: @NickeManarin

Base: masterHead: master


📝 Commits (10+)

  • f538fb6 Merge pull request #2 from NickeManarin/master
  • 7c34b37 Merge pull request #3 from NickeManarin/master
  • 1731ee9 Merge pull request #4 from NickeManarin/master
  • 9c40df7 Merge pull request #5 from NickeManarin/master
  • 1c19c16 Merge pull request #6 from NickeManarin/master
  • 115181f Added getting optimized cultures (without duplicates and redundants)
  • f605a34 Changed localization file names
  • b624f70 Revert "Changed localization file names"
  • 93515fc Changed localization files names
  • a0e0e60 Changed resource link

📊 Changes

10 files changed (+353 additions, -134 deletions)

View changed files

📝 Other/Translator/TranslatorWindow.xaml.cs (+103 -13)
📝 ScreenToGif/App.xaml (+4 -4)
📝 ScreenToGif/Resources/Localization/StringResources.es.xaml (+1 -1)
📝 ScreenToGif/Resources/Localization/StringResources.pt.xaml (+1 -1)
📝 ScreenToGif/Resources/Localization/StringResources.zh-Hant.xaml (+0 -0)
📝 ScreenToGif/Resources/Localization/StringResources.zh.xaml (+0 -0)
📝 ScreenToGif/ScreenToGif.csproj (+4 -4)
📝 ScreenToGif/Util/LocalizationHelper.cs (+77 -87)
📝 ScreenToGif/Windows/Options.xaml (+15 -15)
📝 ScreenToGif/Windows/Other/Localization.xaml.cs (+148 -9)

📄 Description

Currently, all language codes are taken from CultureInfo, both neutral and specific. There are around 800 codes and a lot of them are redundant (for example pl and pl-PL are the same). I tried to take care of this. And after the number of codes dropped to around 500.

Fortunately for us, there is already a list of codes from which we can determine which codes are unnecessary.
https://datahub.io/core/language-codes
This website contains data taken from Unicode and US Library of Congress, so we can be sure that it is up to date and correct. Also, that means the data is public and we can use it (https://datahub.io/core/language-codes#license)
So that's exactly what we want.

I added code that retrieves that data when we have to get language codes. Every time we get language codes, data is taken from datahub servers, so it is up to date. After getting the codes (strings) we can just convert it to corresponding CultureInfo (and since all codes follow a standard we can just compare codes with CultureInfo codes).

There are two places when we have to get language codes: Translator window/app and in ScreenToGif when importing localization from disk. For importing I also added a suggestion which language code is proper when someone is trying to use redundant code.

I tried to do everything in an asynchronous manner.

And finally I made some cosmetic changes:

  • Some already implemented localizations used redundant language codes, so I changed it to proper language codes
  • In ScreenToGif options in Language tab, some languages were missing their nontranslated names (like Polish / Polski). I added those names
  • Added/changed some dialogs
  • Added status band in Translator when getting language codes
  • Improved generic language fallback when selecting language

PS there are a lot of commits because I changed the name of some file, and someone edited contents of this file with the old name in the original repository and I didn't know what was happening 😃 and had to fix it the hard way...


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NickeManarin/ScreenToGif/pull/269 **Author:** [@spietras](https://github.com/spietras) **Created:** 2/12/2018 **Status:** ✅ Merged **Merged:** 2/13/2018 **Merged by:** [@NickeManarin](https://github.com/NickeManarin) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`f538fb6`](https://github.com/NickeManarin/ScreenToGif/commit/f538fb69da191ebd446fe813ba7e5c62e684ed07) Merge pull request #2 from NickeManarin/master - [`7c34b37`](https://github.com/NickeManarin/ScreenToGif/commit/7c34b37289c4e5ce64d45d359c59357592f4cb85) Merge pull request #3 from NickeManarin/master - [`1731ee9`](https://github.com/NickeManarin/ScreenToGif/commit/1731ee914a4a94d75d4e0a072c3aa01685fa9aec) Merge pull request #4 from NickeManarin/master - [`9c40df7`](https://github.com/NickeManarin/ScreenToGif/commit/9c40df7caa1afee1dc543a2582cabcfbfab0cd5a) Merge pull request #5 from NickeManarin/master - [`1c19c16`](https://github.com/NickeManarin/ScreenToGif/commit/1c19c16b218a813a42ceae9c73a886a6f5d2e326) Merge pull request #6 from NickeManarin/master - [`115181f`](https://github.com/NickeManarin/ScreenToGif/commit/115181ffc0abf7c0835536d4abd68eb055e37389) Added getting optimized cultures (without duplicates and redundants) - [`f605a34`](https://github.com/NickeManarin/ScreenToGif/commit/f605a345f2a71dd976cf47d77fdc84940ba0d065) Changed localization file names - [`b624f70`](https://github.com/NickeManarin/ScreenToGif/commit/b624f7053451a7f3be9fb8cd3ce6e1bffb46b64c) Revert "Changed localization file names" - [`93515fc`](https://github.com/NickeManarin/ScreenToGif/commit/93515fc461bec379239332f49795a33706136333) Changed localization files names - [`a0e0e60`](https://github.com/NickeManarin/ScreenToGif/commit/a0e0e606202e08a78b09b9ae9f1df17111983fbb) Changed resource link ### 📊 Changes **10 files changed** (+353 additions, -134 deletions) <details> <summary>View changed files</summary> 📝 `Other/Translator/TranslatorWindow.xaml.cs` (+103 -13) 📝 `ScreenToGif/App.xaml` (+4 -4) 📝 `ScreenToGif/Resources/Localization/StringResources.es.xaml` (+1 -1) 📝 `ScreenToGif/Resources/Localization/StringResources.pt.xaml` (+1 -1) 📝 `ScreenToGif/Resources/Localization/StringResources.zh-Hant.xaml` (+0 -0) 📝 `ScreenToGif/Resources/Localization/StringResources.zh.xaml` (+0 -0) 📝 `ScreenToGif/ScreenToGif.csproj` (+4 -4) 📝 `ScreenToGif/Util/LocalizationHelper.cs` (+77 -87) 📝 `ScreenToGif/Windows/Options.xaml` (+15 -15) 📝 `ScreenToGif/Windows/Other/Localization.xaml.cs` (+148 -9) </details> ### 📄 Description Currently, all language codes are taken from CultureInfo, both neutral and specific. There are around 800 codes and a lot of them are redundant (for example pl and pl-PL are the same). I tried to take care of this. And after the number of codes dropped to around 500. Fortunately for us, there is already a list of codes from which we can determine which codes are unnecessary. https://datahub.io/core/language-codes This website contains data taken from Unicode and US Library of Congress, so we can be sure that it is up to date and correct. Also, that means the data is public and we can use it (https://datahub.io/core/language-codes#license) So that's exactly what we want. I added code that retrieves that data when we have to get language codes. Every time we get language codes, data is taken from datahub servers, so it is up to date. After getting the codes (strings) we can just convert it to corresponding CultureInfo (and since all codes follow a standard we can just compare codes with CultureInfo codes). There are two places when we have to get language codes: Translator window/app and in ScreenToGif when importing localization from disk. For importing I also added a suggestion which language code is proper when someone is trying to use redundant code. I tried to do everything in an asynchronous manner. And finally I made some cosmetic changes: - Some already implemented localizations used redundant language codes, so I changed it to proper language codes - In ScreenToGif options in Language tab, some languages were missing their nontranslated names (like Polish / **Polski**). I added those names - Added/changed some dialogs - Added status band in Translator when getting language codes - Improved generic language fallback when selecting language PS there are a lot of commits because I changed the name of some file, and someone edited contents of this file with the old name in the original repository and I didn't know what was happening 😃 and had to fix it the hard way... --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 09:33:39 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#1101
No description provided.