1 | #!/usr/bin/env python3
|
---|
2 | #
|
---|
3 | # Copyright (C) 2023 Wildfire Games.
|
---|
4 | # This file is part of 0 A.D.
|
---|
5 | #
|
---|
6 | # 0 A.D. is free software: you can redistribute it and/or modify
|
---|
7 | # it under the terms of the GNU General Public License as published by
|
---|
8 | # the Free Software Foundation, either version 2 of the License, or
|
---|
9 | # (at your option) any later version.
|
---|
10 | #
|
---|
11 | # 0 A.D. is distributed in the hope that it will be useful,
|
---|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | # GNU General Public License for more details.
|
---|
15 | #
|
---|
16 | # You should have received a copy of the GNU General Public License
|
---|
17 | # along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
---|
18 |
|
---|
19 | import os
|
---|
20 | import subprocess
|
---|
21 |
|
---|
22 | from i18n_helper import l10nFolderName, transifexClientFolder, projectRootDirectory
|
---|
23 |
|
---|
24 | def main():
|
---|
25 | for root, folders, _ in os.walk(projectRootDirectory):
|
---|
26 | for folder in folders:
|
---|
27 | if folder == l10nFolderName:
|
---|
28 | if os.path.exists(os.path.join(root, folder, transifexClientFolder)):
|
---|
29 | path = os.path.join(root, folder)
|
---|
30 | os.chdir(path)
|
---|
31 | print(f"INFO: Starting to pull translations in {path}...")
|
---|
32 | subprocess.run(["tx", "pull", "-f"])
|
---|
33 |
|
---|
34 |
|
---|
35 | if __name__ == "__main__":
|
---|
36 | main()
|
---|