Skip to content

Commit

Permalink
Fix generating of .mo and .json files for nl translation (#221)
Browse files Browse the repository at this point in the history
The previous glob pattern "??_??" does not match /nl/.
  • Loading branch information
frenzymadness authored Feb 23, 2023
1 parent 60e5ee8 commit 92bb8c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ def finalize_options(self):


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

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

Expand Down

0 comments on commit 92bb8c5

Please sign in to comment.