static-wordpress/tests/test_translations.py

44 lines
1.4 KiB
Python
Raw Normal View History

2023-09-24 01:30:40 +02:00
# -*- coding: utf-8 -*-
"""
STATIC WORDPRESS: WordPress as Static Site Generator
A Python Package for Converting WordPress Installation to a Static Website
2023-09-24 23:25:31 +02:00
https://github.com/serpwings/static-wordpress
2023-09-24 01:30:40 +02:00
tests\test_translations.py
2024-12-21 01:32:32 +01:00
Copyright (C) 2020-2025 Faisal Shahzad <info@serpwings.com>
2023-09-24 01:30:40 +02:00
<LICENSE_BLOCK>
The contents of this file are subject to version 3 of the
GNU General Public License (GPL-3.0). You may not use this file except in
compliance with the License. You may obtain a copy of the License at
https://www.gnu.org/licenses/gpl-3.0.txt
2023-09-24 23:25:31 +02:00
https://github.com/serpwings/static-wordpress/blob/master/LICENSE
2023-09-24 01:30:40 +02:00
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
specific language governing rights and limitations under the License.
</LICENSE_BLOCK>
"""
# +++++++++++++++++++++++++++++++++++++++++++++++++++++
# INTERNAL IMPORTS
# +++++++++++++++++++++++++++++++++++++++++++++++++++++
from staticwordpress.core.i18n import tr
from staticwordpress.core.constants import LANGUAGES
def test_tranlsation_default_language():
tr.language = LANGUAGES.en_US
assert tr.language == LANGUAGES.en_US
assert tr("Close") == "Close"
def test_tranlsation_german():
tr.language = LANGUAGES.de_DE
assert tr.language == LANGUAGES.de_DE
assert tr("Close") == "Schließen"