Skip to content

Commit

Permalink
Merge pull request #3 from session-foundation/fix/crowdin-locale-type…
Browse files Browse the repository at this point in the history
…-guard

fix: add crowdin locale type guard to desktop script
  • Loading branch information
Bilb authored Jan 30, 2025
2 parents 8584158 + 62568d3 commit ade98ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crowdin/generate_desktop_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def convert_non_translatable_strings_to_type_script(input_file, output_path, exp
file.write('\n')
file.write("export type CrowdinLocale = (typeof crowdinLocales)[number];\n")
file.write('\n')
file.write('export function isCrowdinLocale(locale: string): locale is CrowdinLocale {\n')
file.write(' return crowdinLocales.includes(locale as CrowdinLocale);\n')
file.write('}\n')
file.write('\n')


def convert_all_files(input_directory):
Expand Down

0 comments on commit ade98ae

Please sign in to comment.