mirror of
https://github.com/NickeManarin/ScreenToGif.git
synced 2026-04-25 07:05:54 +03:00
[PR #269] [MERGED] Optimizing language codes #1101
Labels
No labels
copy cats
duplicated
future feature
pull-request
⬜ Accepted
⬜ Completed
⬜ Help Wanted 💪
⬜ In Progress
⬜ Missing Details
⬜ Pending
⬜ Waiting For Answer ⏳
🆕 feature preview
🔷 Bug 🐛
🔷 Out Of Scope
🔷 Out Of Scope
🔷 Question
🔷Enhancement
🔷Enhancement
🔷Invalid / External
🔷Knowledge Base
🔷Won't Fix
🕑 High
🕑 High
🕑 High
🕕 Medium
🕙 Low
🕛 Critical
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ScreenToGif#1101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
master← Head:master📝 Commits (10+)
f538fb6Merge pull request #2 from NickeManarin/master7c34b37Merge pull request #3 from NickeManarin/master1731ee9Merge pull request #4 from NickeManarin/master9c40df7Merge pull request #5 from NickeManarin/master1c19c16Merge pull request #6 from NickeManarin/master115181fAdded getting optimized cultures (without duplicates and redundants)f605a34Changed localization file namesb624f70Revert "Changed localization file names"93515fcChanged localization files namesa0e0e60Changed 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:
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.