forked from EVOgeek/Vmeda.Online
		
	Merge pull request #3709 from alfonso-salces/MOBILE-4360
MOBILE-4360 lang: Trim custom string values
This commit is contained in:
		
						commit
						21ff63e413
					
				| @ -380,7 +380,7 @@ export class CoreLangProvider { | |||||||
| 
 | 
 | ||||||
|         const list: string[] = strings.split(/(?:\r\n|\r|\n)/); |         const list: string[] = strings.split(/(?:\r\n|\r|\n)/); | ||||||
|         list.forEach((entry: string) => { |         list.forEach((entry: string) => { | ||||||
|             const values: string[] = entry.split('|'); |             const values: string[] = entry.split('|').map(value => value.trim()); | ||||||
| 
 | 
 | ||||||
|             if (values.length < 3) { |             if (values.length < 3) { | ||||||
|                 // Not enough data, ignore the entry.
 |                 // Not enough data, ignore the entry.
 | ||||||
|  | |||||||
							
								
								
									
										19
									
								
								src/tests/behat/customlangstrings.feature
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/tests/behat/customlangstrings.feature
									
									
									
									
									
										Normal file
									
								
							| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user