Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #363 from GingerAvalanche/master
Browse files Browse the repository at this point in the history
texts.py: Only diff languages the user owns when diffing with 'all_langs' flag set
  • Loading branch information
GingerAvalanche authored Jun 24, 2022
2 parents 62f7415 + 97cc883 commit 85ef78c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bcml/mergers/texts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pathlib import Path
from platform import system
from tempfile import TemporaryDirectory, NamedTemporaryFile
from typing import List, Union, ByteString
from typing import List, Union, Set, ByteString

import oead
import xxhash
Expand Down Expand Up @@ -49,7 +49,7 @@ def swap_region(mod_pack: Path, user_lang: str) -> Path:
return new_pack_path


def map_languages(mod_langs: set, user_langs: list) -> dict:
def map_languages(mod_langs: Set[str], user_langs: Union[set, list]) -> dict:
lang_map: dict = {}
for user_lang in user_langs:
if user_lang in mod_langs:
Expand Down Expand Up @@ -96,7 +96,7 @@ def generate_diff(self, mod_dir: Path, modded_files: List[Union[str, Path]]):
util.vprint(f'Languages: {",".join(languages)}')

game_lang = util.get_settings("lang")
save_langs = LANGUAGES if self._options.get("all_langs", False) else [game_lang]
save_langs = util.get_user_languages() if self._options.get("all_langs", False) else [game_lang]
language_map = map_languages(languages, save_langs)
util.vprint("Language map:")
util.vprint(language_map)
Expand Down

0 comments on commit 85ef78c

Please sign in to comment.