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

all: Switch to l10n API #1399

Merged
merged 10 commits into from
Apr 19, 2023
Merged

all: Switch to l10n API #1399

merged 10 commits into from
Apr 19, 2023

Conversation

bwateratmsft
Copy link
Contributor

@bwateratmsft bwateratmsft commented Feb 24, 2023

Closes #1359.

We'll also need to cascade up the utils and azure packages to fully get rid of vscode-nls.

@bwateratmsft bwateratmsft marked this pull request as ready for review April 19, 2023 14:32
@bwateratmsft bwateratmsft requested a review from a team as a code owner April 19, 2023 14:32
@bwateratmsft bwateratmsft changed the title WIP: [All packages] Switch to l10n API all: Switch to l10n API Apr 19, 2023
@@ -31,12 +30,13 @@ export async function swapSlot(context: IActionContext, sourceSlot: ParsedSite,
}
}

const placeHolder: string = localize('selectSlotToSwap', 'Select which slot to swap with "{0}".', sourceSlot.slotName);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const placeHolder: string = l10n.t('Select which slot to swap with "{0}".', sourceSlot.slotName!);
Copy link
Member

Choose a reason for hiding this comment

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

Normally I'd say we should probably use nonNullValue(), but throwing an error because of a string error seems excessive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's also partly because the Swagger definitions for these APIs suggest that some things can be optional, that never actually can be optional. The ! "operator" seems fitting in that scenario.

@bwateratmsft bwateratmsft merged commit 49b7438 into main Apr 19, 2023
@bwateratmsft bwateratmsft deleted the bmw/l10n branch April 19, 2023 17:36
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.

Use VSCode's new localization API
2 participants