Skip to content

Commit 92bb8c5

Browse files
Fix generating of .mo and .json files for nl translation (#221)
The previous glob pattern "??_??" does not match /nl/.
1 parent 60e5ee8 commit 92bb8c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

setupbase.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ def finalize_options(self):
347347

348348

349349
def run(self):
350-
paths = glob('nbclassic/i18n/??_??')
350+
paths = glob('nbclassic/i18n/*/LC_MESSAGES')
351351
for p in paths:
352-
LANG = p[-5:]
352+
LANG = p.split(os.path.sep)[-2]
353353
for component in ['nbclassic', 'nbui']:
354354
run(['pybabel', 'compile',
355355
'-D', component,
@@ -557,7 +557,7 @@ def build_main(self, name):
557557
run(['node', 'tools/build-main.js', name])
558558

559559
def build_jstranslation(self, trd):
560-
lang = trd[-5:]
560+
lang = trd.split(os.path.sep)[-2]
561561
run([
562562
pjoin('node_modules', '.bin', 'po2json'),
563563
'-p', '-F',
@@ -573,7 +573,7 @@ def run(self):
573573
env['PATH'] = npm_path
574574
pool = ThreadPool()
575575
pool.map(self.build_main, self.apps)
576-
pool.map(self.build_jstranslation, glob('nbclassic/i18n/??_??'))
576+
pool.map(self.build_jstranslation, glob('nbclassic/i18n/*/LC_MESSAGES'))
577577
# update package data in case this created new files
578578
update_package_data(self.distribution)
579579

0 commit comments

Comments
 (0)