mirror of
				https://codeberg.org/1414codeforge/moonspeak.git
				synced 2025-06-05 22:09:19 +02:00 
			
		
		
		
	[init] handle the case in which translate() gets called with no dictionary.
This commit is contained in:
		
							
								
								
									
										3
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								init.lua
									
									
									
									
									
								
							| @@ -90,8 +90,9 @@ end | |||||||
| -- | -- | ||||||
| -- @return localized and formatted string. | -- @return localized and formatted string. | ||||||
| function moonspeak.translate(id, ...) | function moonspeak.translate(id, ...) | ||||||
|     local msg = rawget(moonspeak.dict, id) |     local dict = moonspeak.dict | ||||||
|     local lang = moonspeak.lang |     local lang = moonspeak.lang | ||||||
|  |     local msg  = dict and dict[id] or nil | ||||||
|  |  | ||||||
|     if msg ~= nil and msg[lang] then |     if msg ~= nil and msg[lang] then | ||||||
|         -- Found localized string. |         -- Found localized string. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user