From f2d32a90bbcaf491effc4beef5f8b4dc0aa82b8e Mon Sep 17 00:00:00 2001 From: Giorgio Garofalo Date: Thu, 19 Sep 2024 01:40:06 +0200 Subject: [PATCH] Add missing Context.localizationTables documentation --- .../main/kotlin/eu/iamgio/quarkdown/context/Context.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt index bf6df901..57b955b7 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/context/Context.kt @@ -55,6 +55,11 @@ interface Context { */ val libraries: Set + /** + * Tables that store key-value localization pairs for each supported locale. + * Each table is identified by a unique name. + * @see localize + */ val localizationTables: LocalizationTables /** @@ -98,13 +103,15 @@ interface Context { fun resolveUnchecked(call: FunctionCallNode): UncheckedFunctionCall<*> /** - * @param tableName name of the localization table + * Localizes a string to this context's language (the locale set in [documentInfo]) by looking up a key in a localization table. + * @param tableName name of the localization table, which must exist within [localizationTables] * @param key localization key to look up within the table * @return the localized string corresponding to the key in the table, if there is any * @throws eu.iamgio.quarkdown.localization.LocaleNotSetException if a locale is not set within [documentInfo] * @throws eu.iamgio.quarkdown.localization.LocalizationTableNotFoundException if the table does not exist * @throws eu.iamgio.quarkdown.localization.LocalizationKeyNotFoundException if the locale does not exist in the table * @throws eu.iamgio.quarkdown.localization.LocalizationKeyNotFoundException if the key does not exist in the table entry for the locale + * @see localizationTables */ fun localize( tableName: String,