docs: add Javadoc
This commit is contained in:
		
							parent
							
								
									8dd547404d
								
							
						
					
					
						commit
						faf7d12001
					
				| @ -8,7 +8,7 @@ import org.apache.velocity.VelocityContext; | |||||||
| import org.apache.velocity.tools.ToolManager; | import org.apache.velocity.tools.ToolManager; | ||||||
| import org.apache.velocity.util.StringBuilderWriter; | import org.apache.velocity.util.StringBuilderWriter; | ||||||
| 
 | 
 | ||||||
| // FIXME doc, tests | // FIXME tests | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * This class aims to generate localized messages or strings either merging Velocity templates or |  * This class aims to generate localized messages or strings either merging Velocity templates or | ||||||
| @ -61,10 +61,27 @@ public class TemplateContentGenerator { | |||||||
|     return content.toString(); |     return content.toString(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /** | ||||||
|  |    * Get a localized {@link String} | ||||||
|  |    * | ||||||
|  |    * @param locale a provided {@link Locale} | ||||||
|  |    * @param key the key that will be retrieved from the localized messages | ||||||
|  |    * @return a localized {@link String} | ||||||
|  |    * @see #getString(String, String) | ||||||
|  |    */ | ||||||
|   public String getString(Locale locale, String key) { |   public String getString(Locale locale, String key) { | ||||||
|     return localizedMessageFactory.createResourceBundle(locale).getString(key); |     return localizedMessageFactory.createResourceBundle(locale).getString(key); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   /** | ||||||
|  |    * Get a localized {@link String} | ||||||
|  |    * | ||||||
|  |    * @param localeAsString a provided {@link Locale} as a {@link String}. Will be converted using | ||||||
|  |    *     {@link Locale#forLanguageTag(String)} | ||||||
|  |    * @param key the key that will be retrieved from the localized messages | ||||||
|  |    * @return a localized {@link String} | ||||||
|  |    * @see #getString(Locale, String) | ||||||
|  |    */ | ||||||
|   public String getString(String localeAsString, String key) { |   public String getString(String localeAsString, String key) { | ||||||
|     return getString(Locale.forLanguageTag(localeAsString), key); |     return getString(Locale.forLanguageTag(localeAsString), key); | ||||||
|   } |   } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user