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

Create bug-free i18n API #473

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from
Draft

Create bug-free i18n API #473

wants to merge 58 commits into from

Conversation

meadowsys
Copy link
Member

PR #446 could have used a bit more testing/validation (and actually looking at the CI) before merging, and so its been reverted now. This is attempt 2, we try to bug fix and make sure it doesn't break Pulsar before merging.

It could be an object (like, not yet reached the end and found a string), which wouldn't work here
remnants of before i discovered `PackageManager::getAvailablePackages`
In addition to regular `label` key in a menu item, you can now have a `localisedLabel` key. This can either point to a key, or can point to an object, with properties `key` and `opts` for values to interpolate.
sorry this was bothering me lol
loading is done at startup if present, saving not yet implemented
meadowsys and others added 10 commits April 14, 2023 12:42
Move them all to the dynamic place, so that its consistently in one place, and remove the last 2 settings that aren't currently in use
Provided as second argument, so, `activate(_, { t })`
Co-authored-by: confused-Techie <[email protected]>
This is called once in the constructor, then again in `initialize`. The constructor call was too early, and `i18n.t` had not been available yet, but it was used by `loadBundledKeymaps`.
@meadowsys
Copy link
Member Author

rebased onto master (I got a bit really annoyed with git)

@meadowsys
Copy link
Member Author

All the failures are consistently failing on https://github.com/pulsar-edit/pulsar/blob/i18n/packages/background-tips/lib/tips.js#L3 for some reason

thought about renaming that function from `buildAtomEnvironment` to `setupAtomEnvironment` because it now sets everything up including putting it onto `window.atom` but i don't wanna touch that ueeeeee
grammar-selector is causing t to be called for `language-test`, which isn't available in `packages.find(p => p.name === ns);` for whatever reason

<ignore this>
@@ -242,7 +241,8 @@ module.exports = MenuManager = class MenuManager {
}

sortPackagesMenu() {
const packagesMenu = _.find(this.template, ({id}) => MenuHelpers.normalizeLabel(id) === 'Packages');
let packagesLabel = this.i18n.t("core.menu.packages.self");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let packagesLabel = this.i18n.t("core.menu.packages.self");
const packagesLabel = this.i18n.t("core.menu.packages.self");

@meadowsys meadowsys mentioned this pull request Sep 12, 2023
@meadowsys
Copy link
Member Author

superceded by #715 (I want to keep the branch around for now, Just In Case™ I want to reference something from it, will delete after I'm sure I don't need it anymore)

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