Skip to content

fix(i18n): fix error where locale file not being loaded#374

Merged
craicoverflow merged 1 commit intomainfrom
fix-i18n-errors
Feb 22, 2021
Merged

fix(i18n): fix error where locale file not being loaded#374
craicoverflow merged 1 commit intomainfrom
fix-i18n-errors

Conversation

@craicoverflow
Copy link
Contributor

@craicoverflow craicoverflow commented Feb 22, 2021

fixes #370

This fixes a major bug where locales files which were being loaded in an init function did not load as the file was not found.

The solution to this was to load all message files at the start of the program.

Verification

  1. Run make install
  2. Run the rhoas CLI from your workspace root ($HOME).

@wtrocki
Copy link
Collaborator

wtrocki commented Feb 22, 2021

@craicoverflow can we measure time before and after load on your mac. How long it takes to load those?

@craicoverflow
Copy link
Contributor Author

craicoverflow commented Feb 22, 2021

Before:

❯ rhoas whoami
ephelan_kafka_devexp
6.263725ms
❯ rhoas whoami
ephelan_kafka_devexp
5.774509ms
❯ rhoas whoami
ephelan_kafka_devexp
8.273752ms
❯ rhoas whoami
ephelan_kafka_devexp
7.100388ms
❯ rhoas whoami
ephelan_kafka_devexp
12.748368ms
❯ rhoas whoami
ephelan_kafka_devexp
6.429762ms
❯ rhoas whoami
ephelan_kafka_devexp
5.967854ms
❯ rhoas whoami
ephelan_kafka_devexp
8.741398ms
❯ rhoas whoami
ephelan_kafka_devexp
8.619696ms

After:

ephelan_kafka_devexp
6.359273ms
❯ rhoas whoami
ephelan_kafka_devexp
6.031368ms
❯ rhoas whoami
ephelan_kafka_devexp
6.210349ms
❯ rhoas whoami
ephelan_kafka_devexp
7.943102ms
❯ rhoas whoami
ephelan_kafka_devexp
5.666126ms
❯ rhoas whoami
ephelan_kafka_devexp
6.77167ms
❯ rhoas whoami
ephelan_kafka_devexp
8.101047ms

@craicoverflow
Copy link
Contributor Author

There is no discernible differences.

@craicoverflow
Copy link
Contributor Author

ping @wtrocki @rkpattnaik780

@wtrocki
Copy link
Collaborator

wtrocki commented Feb 22, 2021

So to clarify. We still compiling codebase using make pkger. but then at runtime we simply load all of the compiled indexes from golang file?

I would go with:

  • Create new issue: failing build/release build when make pkger brings any new changes (this will slow build but it is worth it)
  • Possibly reduce number of language files over the time. I many time got lost by number of files that were by design loaded in individual code. Since we load them now all it makes sense to organize them to be developer-friendly and aid finding missing/not used keys.

@craicoverflow
Copy link
Contributor Author

Yep

@craicoverflow craicoverflow merged commit ce40d2a into main Feb 22, 2021
@craicoverflow craicoverflow deleted the fix-i18n-errors branch February 22, 2021 12:03
@wtrocki
Copy link
Collaborator

wtrocki commented Feb 22, 2021

@craicoverflow I would suggest some follow ups for this later phase:

  • Create new issue: failing build/release build when make pkger brings any new changes (this will slow build but it is worth it)
  • Possibly reduce number of language files over the time. I many time got lost by number of files that were by design loaded in individual code. Since we load them now all it makes sense to organize them to be developer-friendly and aid finding missing/not used keys.

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.

unable to use rhoas(latest) on macOS

2 participants