lettuce_webdriver icon indicating copy to clipboard operation
lettuce_webdriver copied to clipboard

Internationalization

Open Sabst opened this issue 13 years ago • 1 comments

Hi, Lettuce supports multiple languages. lettuce_webdriver should support those languages too. Or at least, defining new translations should not duplicate the webdriver logic (for now I copied webdriver.py steps to my terrain.py file and translated the steps).

Sabst avatar Dec 03 '11 21:12 Sabst

Here is my current workaround to avoid duplicating code. Any better solution is welcome. ... something like in my terrain.py file (indentations do not appear):

@step('je devrais voir "([^"]+)"$') def should_see(step, text): for regex, func in STEP_REGISTRY.items(): matched = (regex == r'I should see "([^"]+)"$') if matched: func(step, text) break

Sabst avatar Dec 06 '11 22:12 Sabst