Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core - Improvements to i18n #157

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Conversation

EmmmaTech
Copy link
Contributor

@EmmmaTech EmmmaTech commented Mar 27, 2021

Implements #127 and #130, all in one Pull Request.
This Pull Request aims to improves i18n and BRLS_ASSET.

Features implemented before this PR was made:

  • Switches from using JSON to XML for i18n
  • Removes the linter script (partly replaced with printing errors)
  • Move built-in brls strings to source code (like built-in views XML)
  • Add an opt-out feature to disable i18n (still loads internal translations)
  • Change BRLS_ASSET from a macro to an inline static function
  • Use std::filesystem::path to convert to a platform-specific directory separator
  • Add method to get locale for the GLFW Platform (tested on macOS Big Sur 11.0.1)

To-do with this Pull Request:

  • Nothing, for now

What's finished:

  • See "Features implemented before this PR was made"
  • Write a Python script to convert an i18n JSON to i18n XML
  • Fully re-implement linter script inside of the library
  • Change how internal translations are loaded to what it was before (instead of loading to a separate unordered map, load to the current or default locale unordered map)

The internal translations are in en-US at the moment.

The source code for built-in views and other core elements are not updated to use this yet.
All - replaced _i18n with _internal when needed

i18n - Moved for loop for loadLocale into a new function

i18n - Made loadInternal public to other files (mostly for Application)
i18n - Slightly changed how internalXML was defined

i18n - Added too much comments

GLFW Platform - Added method to get locale (might work on certain platforms)

Scripts - Remove i18n-linter
i18n - Comment improvements

Application - Info message improvements
Resources - Converted demo.json to demo.xml

Box - Using BRLS_ASSET instead of manual method
@EmmmaTech EmmmaTech changed the title Core- Improvements to i18n Core - Improvements to i18n Mar 27, 2021
@EmmmaTech
Copy link
Contributor Author

I like how I replaced a fatty library with a even more fatty library

@EmmmaTech EmmmaTech changed the title Core - Improvements to i18n Core - Improvements to i18n and adding F14FastMap Mar 31, 2021
All - Clang-Format
GLFW Platform - Changed error message of incompatible locale to mention the locale
@EmmmaTech
Copy link
Contributor Author

No, I downloaded the 2021.03.22.00 release, It should be a subrepo

…xtern/folly

subrepo:
  subdir:   "library/lib/extern/folly"
  merged:   "09cc63cb9"
upstream:
  origin:   "https://github.com/facebook/folly.git"
  branch:   "master"
  commit:   "09cc63cb9"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"
@EmmmaTech
Copy link
Contributor Author

Okay done. It's now a subrepo! Also, just so you can know, the Switch build still uses std::unordered_map. IIRC, I couldn't get it to build, so GLFW will be using F14FastMap for now.

@natinusala
Copy link
Owner

natinusala commented Apr 2, 2021 via email

@EmmmaTech
Copy link
Contributor Author

EmmmaTech commented Apr 2, 2021

Yeah. It freaks out after it can't find file folly-config.h. And even after providing that file, it still didn't work IIRC. Edit: it's because it can't find header __config.

@EmmmaTech EmmmaTech changed the title Core - Improvements to i18n and adding F14FastMap Core - Improvements to i18n Nov 7, 2021
@EmmmaTech
Copy link
Contributor Author

I decided to remove Folly because the library is too big and we're only using it for one purpose. Someone else can add it back later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants