Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 0 additions & 99 deletions .github/actions/localization/action.yml

This file was deleted.

64 changes: 0 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,70 +66,6 @@ Use the Node.js version pinned in `.nvmrc` for development.

## Consuming in Extensions

### Shared localization automation

The composite action at `.github/actions/localization` and the standard-library
Python CLI at `scripts/localization.py` share localization automation across the
Python extensions. This tooling does not require adopting either runtime library.
Pin the action and Azure tooling checkout to the same reviewed commit.

Each extension's English-only GitHub workflow calls:

```yaml
permissions:
contents: read

jobs:
localization:
runs-on: ubuntu-latest
steps:
- uses: microsoft/vscode-common-python-lsp/.github/actions/localization@<reviewed-commit-sha>
with:
app-id: ${{ vars.PYTHON_LOCALIZATION_APP_ID }}
private-key: ${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }}
submodules: recursive
source-paths: '["src", "external/vscode-common-python-lsp/typescript/src"]'
```

Keep trigger paths and concurrency in the caller workflow. Omit the submodule
input and use the default `["src"]` for standalone runtime extensions. Extensions
without a `package.json` `l10n` declaration export and import manifest strings
only, even if their source contains runtime localization calls.

The action bundles checkout, Node/Python setup, extraction with pinned
`@vscode/l10n-dev@0.0.35`, app authentication, and English submission. It loads the
helper from its own action revision. Configure the app ID variable and private-key
secret in each caller (or grant organization-level access); the app needs Contents
write access only to `microsoft/vscode-python-extensions-loc`. The default npm feed
is `https://packagefeedproxy.microsoft.io/npm/`. Inputs never appear in generated
shell commands: source paths and branch values are passed through environment
variables.

English goes to `src/en/<publisher>.<name>/<publisher>.<name>-new.xlf` on the
existing `dev` branch. Unchanged XLF is a successful no-op. Submissions never
force-push; concurrent updates retry rejected pushes with a bounded rebase.

Pylance-Eng stable/pre-release templates orchestrate **pull-only** imports using
the same CLI, with source, tools, and translations in separate workspace folders:

```text
python <tools>/scripts/localization.py --operation import \
--extension-root <extension> --translations-root <drop>/out \
--output-directory <new-staging-directory>
```

The importer derives identity/runtime metadata from the extension manifest,
requires all 14 configured locales, and validates every table before copying.
Untranslated strings and wholly untranslated tables are allowed: users see the
English text until translated handbacks arrive. Translation state does not gate
release packaging. Missing, empty, malformed, or incomplete handbacks still fail
explicitly, including missing runtime tables when runtime localization is declared.

Generated root `package.nls.<locale>.json` and declared runtime locale files should
be ignored by Git but included by VSCE. Keep English `package.nls.json` tracked.
Run dependency-free regression tests with
`python -m unittest discover -s scripts -p "*_test.py"`.

### Shared runtime libraries

Consume this repository as a git submodule so the Python and TypeScript
Expand Down
10 changes: 0 additions & 10 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ def install(session: nox.Session) -> None:
@nox.session()
def tests(session: nox.Session) -> None:
"""Run Python tests."""
session.run(
"python", "-m", "unittest", "discover", "-s", "scripts", "-p", "*_test.py"
)
session.install("-e", "./python[dev]")
session.run("pytest", "python/tests", "-v")

Expand All @@ -34,10 +31,3 @@ def lint(session: nox.Session) -> None:

session.run("isort", "--check", "python/vscode_common_python_lsp")
session.run("isort", "--check", "python/tests")
session.run("flake8", "scripts/localization.py", "scripts/localization_test.py")
session.run(
"black", "--check", "scripts/localization.py", "scripts/localization_test.py"
)
session.run(
"isort", "--check", "scripts/localization.py", "scripts/localization_test.py"
)
Loading
Loading