Migrate translations upload to use Lokalise CLI 2 (#36247)
parent
ff9de687c0
commit
35c00fed6d
|
@ -3,7 +3,6 @@ import pathlib
|
||||||
|
|
||||||
CORE_PROJECT_ID = "130246255a974bd3b5e8a1.51616605"
|
CORE_PROJECT_ID = "130246255a974bd3b5e8a1.51616605"
|
||||||
FRONTEND_PROJECT_ID = "3420425759f6d6d241f598.13594006"
|
FRONTEND_PROJECT_ID = "3420425759f6d6d241f598.13594006"
|
||||||
CLI_1_DOCKER_IMAGE = "b8329d20280263cad04f65b843e54b9e8e6909a348a678eac959550b5ef5c75f"
|
|
||||||
CLI_2_DOCKER_IMAGE = "v2.3.0"
|
CLI_2_DOCKER_IMAGE = "v2.3.0"
|
||||||
INTEGRATIONS_DIR = pathlib.Path("homeassistant/components")
|
INTEGRATIONS_DIR = pathlib.Path("homeassistant/components")
|
||||||
FRONTEND_DIR = pathlib.Path("../frontend")
|
FRONTEND_DIR = pathlib.Path("../frontend")
|
||||||
|
|
|
@ -6,7 +6,7 @@ import pathlib
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from .const import CLI_1_DOCKER_IMAGE, CORE_PROJECT_ID, INTEGRATIONS_DIR
|
from .const import CLI_2_DOCKER_IMAGE, CORE_PROJECT_ID, INTEGRATIONS_DIR
|
||||||
from .error import ExitApp
|
from .error import ExitApp
|
||||||
from .util import get_current_branch, get_lokalise_token
|
from .util import get_current_branch, get_lokalise_token
|
||||||
|
|
||||||
|
@ -26,21 +26,21 @@ def run_upload_docker():
|
||||||
"-v",
|
"-v",
|
||||||
f"{LOCAL_FILE}:{CONTAINER_FILE}",
|
f"{LOCAL_FILE}:{CONTAINER_FILE}",
|
||||||
"--rm",
|
"--rm",
|
||||||
f"lokalise/lokalise-cli@sha256:{CLI_1_DOCKER_IMAGE}",
|
f"lokalise/lokalise-cli-2:{CLI_2_DOCKER_IMAGE}",
|
||||||
# Lokalise command
|
# Lokalise command
|
||||||
"lokalise",
|
"lokalise2",
|
||||||
"--token",
|
"--token",
|
||||||
get_lokalise_token(),
|
get_lokalise_token(),
|
||||||
"import",
|
"--project-id",
|
||||||
CORE_PROJECT_ID,
|
CORE_PROJECT_ID,
|
||||||
|
"file",
|
||||||
|
"upload",
|
||||||
"--file",
|
"--file",
|
||||||
CONTAINER_FILE,
|
CONTAINER_FILE,
|
||||||
"--lang_iso",
|
"--lang-iso",
|
||||||
LANG_ISO,
|
LANG_ISO,
|
||||||
"--convert_placeholders",
|
"--convert-placeholders=false",
|
||||||
"0",
|
"--replace-modified",
|
||||||
"--replace",
|
|
||||||
"1",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
print()
|
print()
|
||||||
|
|
Loading…
Reference in New Issue