move other i18n scripts to ftl/

This commit is contained in:
Damien Elmes 2020-11-22 15:37:18 +10:00
parent 52617511b0
commit 1e8e4ee603
7 changed files with 29 additions and 20 deletions

View File

@ -27,6 +27,26 @@ py_test(
deps = [requirement("fluent-syntax")],
)
py_binary(
name = "sync",
srcs = ["sync.py"],
tags = ["manual"],
)
py_binary(
name = "extract-strings",
srcs = ["extract-strings.py"],
tags = ["manual"],
deps = [requirement("fluent-syntax")],
)
py_binary(
name = "transform-string",
srcs = ["transform-string.py"],
tags = ["manual"],
deps = [requirement("fluent-syntax")],
)
# export this file as a way of locating the top level folder in $(location ...)
exports_files(
["BUILD.bazel"],

3
ftl/README.md Normal file
View File

@ -0,0 +1,3 @@
Files related to Anki's translations.
Please see https://translating.ankiweb.net/#/anki/developers

View File

@ -10,11 +10,9 @@ import os
import sys
from typing import Optional, Tuple
repos_bzl = "repos.bzl"
working_folder = "../anki-i18n"
if not os.path.exists(repos_bzl):
raise Exception("run from workspace root")
root = os.environ["BUILD_WORKSPACE_DIRECTORY"]
repos_bzl = os.path.join(root, "repos.bzl")
working_folder = os.path.join(root, "..", "anki-i18n")
if not os.path.exists(working_folder):
os.mkdir(working_folder)
@ -35,12 +33,12 @@ modules = [
Module(
name="core",
repo="git@github.com:ankitects/anki-core-i18n",
ftl=("ftl/core", "core/templates"),
ftl=(os.path.join(root, "ftl", "core"), "core/templates"),
),
Module(
name="qtftl",
repo="git@github.com:ankitects/anki-desktop-ftl",
ftl=("ftl/qt", "desktop/templates"),
ftl=(os.path.join(root, "ftl", "qt"), "desktop/templates"),
),
]
@ -103,7 +101,7 @@ def update_repos_bzl():
out.append(line)
open(path, "w").writelines(out)
commit_if_changed(".")
commit_if_changed(root)
def commit_if_changed(folder: str):

View File

@ -7,15 +7,3 @@ py_binary(
stamp = 1,
visibility = ["//visibility:public"],
)
py_binary(
name = "extract-strings",
srcs = ["extract-strings.py"],
deps = [requirement("fluent-syntax")],
)
py_binary(
name = "transform-string",
srcs = ["transform-string.py"],
deps = [requirement("fluent-syntax")],
)