MOBILE-4360 lang: Trim custom string values
parent
d7a18dd36c
commit
fec9d13607
|
@ -380,7 +380,7 @@ export class CoreLangProvider {
|
|||
|
||||
const list: string[] = strings.split(/(?:\r\n|\r|\n)/);
|
||||
list.forEach((entry: string) => {
|
||||
const values: string[] = entry.split('|');
|
||||
const values: string[] = entry.split('|').map(value => value.trim());
|
||||
|
||||
if (values.length < 3) {
|
||||
// Not enough data, ignore the entry.
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
@app @javascript
|
||||
Feature: Custom lang strings
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username |
|
||||
| student1 |
|
||||
|
||||
Scenario: Customlangstrings without whitespaces
|
||||
Given the following config values are set as admin:
|
||||
| customlangstrings | core.courses.mycourses\|Foo\|en | tool_mobile |
|
||||
When I entered the app as "student1"
|
||||
Then I should be able to press "Foo" in the app
|
||||
|
||||
Scenario: Customlangstrings with whitespaces
|
||||
Given the following config values are set as admin:
|
||||
| customlangstrings | core.courses.mycourses\| Foo with whitespaces \|en | tool_mobile |
|
||||
When I entered the app as "student1"
|
||||
Then I should be able to press "Foo with whitespaces" in the app
|
Loading…
Reference in New Issue