bimtester: improve step translation

This commit is contained in:
Bernd Hahnebach
2021-01-07 18:02:09 +01:00
parent ef3f9489ea
commit bf41ee013c
5 changed files with 26 additions and 8 deletions
@@ -6,9 +6,12 @@ from utils import IfcFile
from utils import switch_locale
the_lang = "en"
@step("there are no {ifc_class} elements because {reason}")
def step_impl(context, ifc_class, reason):
switch_locale(context.localedir, "en")
switch_locale(context.localedir, the_lang)
aem.no_eleclass_because_reason(
context,
ifc_class,
@@ -18,7 +21,7 @@ def step_impl(context, ifc_class, reason):
@step('all {ifc_class} elements class attributes have a value')
def step_impl(context, ifc_class):
switch_locale(context.localedir, "en")
switch_locale(context.localedir, the_lang)
aem.eleclass_have_class_attributes_with_a_value(
context,
ifc_class
@@ -27,7 +30,7 @@ def step_impl(context, ifc_class):
@step('all {ifc_class} elements have a name given')
def step_impl(context, ifc_class):
switch_locale(context.localedir, "en")
switch_locale(context.localedir, the_lang)
aem.eleclass_has_name_with_a_value(
context,
ifc_class
@@ -36,7 +39,7 @@ def step_impl(context, ifc_class):
@step('all {ifc_class} elements have a description given')
def step_impl(context, ifc_class):
switch_locale(context.localedir, "en")
switch_locale(context.localedir, the_lang)
aem.eleclass_has_description_with_a_value(
context,
ifc_class
@@ -6,9 +6,12 @@ from utils import IfcFile
from utils import switch_locale
the_lang = "en"
@step("all {ifc_class} elements have an {aproperty} property in the {pset} pset")
def step_impl(context, ifc_class, aproperty, pset):
switch_locale(context.localedir, "en")
switch_locale(context.localedir, the_lang)
apm.eleclass_has_property_in_pset(
context,
ifc_class,
@@ -6,6 +6,10 @@ from ifcdata_methods import assert_schema
from utils import IfcFile
from utils import switch_locale
the_lang = "en"
@step('The IFC schema "{schema}" must be provided')
def step_impl(context, schema):
try:
@@ -38,7 +42,7 @@ def step_impl(context):
@step("IFC data must use the {schema} schema")
def step_impl(context, schema):
switch_locale(context.localedir, "en")
switch_locale(context.localedir, the_lang)
assert_schema(context, schema)
@@ -3,7 +3,11 @@ from behave import step
from ifcdata_methods import assert_schema
from utils import switch_locale
the_lang = "de"
@step("Die IFC Daten müssen das {schema} Schema benutzen")
def step_impl(context, schema):
switch_locale(context.localedir, "de")
switch_locale(context.localedir, the_lang)
assert_schema(context, schema)
@@ -3,7 +3,11 @@ from behave import step
from ifcdata_methods import assert_schema
from utils import switch_locale
the_lang = "fr"
@step("Les données IFC doivent utiliser le schéma {schema}")
def step_impl(context, schema):
switch_locale(context.localedir, "fr")
switch_locale(context.localedir, the_lang)
assert_schema(context, schema)