diff --git a/.github/scripts/build_translation_cache.py b/.github/scripts/build_translation_cache.py index b5797010..73919c38 100644 --- a/.github/scripts/build_translation_cache.py +++ b/.github/scripts/build_translation_cache.py @@ -102,6 +102,12 @@ PROTECTED_TECHNICAL_TERMS = ( "WebUI", "Intel", "CUDA", + "ROCm", + "Vulkan", + "SYCL", + "QSV", + "OpenVINO", + "OpenCL", "KFD", "GPU", "CPU", diff --git a/.github/scripts/tests/test_translation_protected_terms.py b/.github/scripts/tests/test_translation_protected_terms.py new file mode 100644 index 00000000..d88a4a50 --- /dev/null +++ b/.github/scripts/tests/test_translation_protected_terms.py @@ -0,0 +1,25 @@ +"""A label made only of product and API names is right when it comes back +unchanged, so the translation bot keeps it instead of retrying and dropping it.""" +from pathlib import Path +import sys +import unittest + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +import build_translation_cache as cache # noqa: E402 + + +class ProtectedTermsTests(unittest.TestCase): + def test_acceleration_profile_labels_are_kept_unchanged(self): + for label in ("Intel/AMD (Vulkan)", "AMD (ROCm)", "Intel (SYCL)", "NVIDIA (CUDA)", + "Intel/AMD (VA-API)", "Intel (OpenVINO)"): + with self.subTest(label=label): + self.assertTrue(cache.is_fully_protected(label)) + self.assertFalse(cache.looks_untranslated(label, label)) + + def test_a_sentence_coming_back_unchanged_is_still_a_failure(self): + sentence = "The GPU is used through Vulkan when it is available" + self.assertTrue(cache.looks_untranslated(sentence, sentence)) + + +if __name__ == "__main__": + unittest.main() diff --git a/lang/sk.json b/lang/sk.json index 93e29b34..2ea57715 100644 --- a/lang/sk.json +++ b/lang/sk.json @@ -3505,6 +3505,7 @@ "Intel render device for recognition": "Zariadenie na rozpoznávanie informácií", "Intel/AMD (VA-API and QSV)": "Intel/AMD (VA-API a QSV)", "Intel/AMD (VA-API)": "Intel/AMD (VA-API)", + "Intel/AMD (Vulkan)": "Intel/AMD (Vulkan)", "Intel/AMD (streaming rendering and encoding)": "Intel/AMD (vykresľovanie a kódovanie streamu)", "Intel/AMD DRM node (device only)": "Intel/AMD uzol DRM (iba zariadenie)", "Intel/AMD VA-API": "Intel/AMD VA-API",