diff --git a/src/vips_reference_model/images/DeadParrot.png b/src/vips_reference_model/images/DeadParrot.png new file mode 100644 index 0000000000000000000000000000000000000000..63e8fd7736d53909c7f07875be80bf0ad3367002 Binary files /dev/null and b/src/vips_reference_model/images/DeadParrot.png differ diff --git a/src/vips_reference_model/images/Monty_python_foot.png b/src/vips_reference_model/images/Monty_python_foot.png new file mode 100644 index 0000000000000000000000000000000000000000..4356ef0cd0ea914ab814951f0aae1d1461a9c2c8 Binary files /dev/null and b/src/vips_reference_model/images/Monty_python_foot.png differ diff --git a/src/vips_reference_model/reference_model.py b/src/vips_reference_model/reference_model.py index 6386d525cc511ef770ad789788c3208ee113dbdc..51069755daca913e2c7b110f6f271bfc726164fc 100644 --- a/src/vips_reference_model/reference_model.py +++ b/src/vips_reference_model/reference_model.py @@ -16,6 +16,7 @@ LICENSE = """ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. """ +import pathlib from vipscore_common.vips_model import VIPSModel from vipscore_common.entities import Result, ModelConfiguration, WeatherObservation @@ -129,13 +130,20 @@ class ReferenceModel(VIPSModel): def get_model_description(self, language = VIPSModel.default_language) -> str: """Returns the model description in the specified language (<a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO-639-2</a>)""" - return """ - The model is a reference model for developers, showcasing best practices and functionalities of a model. - It's a simple day degree model for an imagined pest, and when thresholds are passed, the warning status progresses. - """ + + # This method (get_text_with_base64_encoded_images) is defined in the VIPSModel base class + return self.get_text_with_base64_encoded_images( + translations.description.get( + language, + translations.description.get(VIPSModel.default_language, "NOT FOUND") + ), + pathlib.Path(__file__).parent + ) + def get_warning_status_interpretation(self, language = VIPSModel.default_language) -> str: """How to interpret the warning status (red-yellow-green, what does it mean?) in the specified language (<a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO-639-2</a>)""" + return translations.wsi.get(language, translations.wsi.get(VIPSModel.default_language, "NOT FOUND")) def get_model_usage(self, language = VIPSModel.default_language) -> str: diff --git a/src/vips_reference_model/translations.py b/src/vips_reference_model/translations.py index 00f6dafb2de1d09a1da27a5d0641e34ed73dfd7b..4f46a3b5a8d2a2529c9a1477cb580cd42c74cd0b 100644 --- a/src/vips_reference_model/translations.py +++ b/src/vips_reference_model/translations.py @@ -24,29 +24,17 @@ name = { description = { "en": """ - Well, there's egg and bacon, - Egg sausage and bacon - Egg and spam - Egg, bacon and spam - Egg, bacon, sausage and spam - Spam, bacon, sausage and spam - Spam, egg, spam, spam, bacon and spam - Spam, sausage, spam, spam, spam, bacon, spam tomato and spam - Spam, spam, spam, egg and spam - Spam, spam, spam, spam, spam, spam, baked beans, spam, spam, spam and spam. + {{filename="/images/Monty_python_foot.png" description="Av Agnolo Bronzino – Bronzino's Venus, Cupid, Folly and Time, authored by User:Husky., Offentlig eiendom, https://commons.wikimedia.org/w/index.php?curid=3595935"}} + The model is a reference model for developers, showcasing best practices and functionalities of a model. + It's a simple day degree model for an imagined pest, and when thresholds are passed, the warning status progresses. + {{filename="/images/DeadParrot.png" description="This is a dead parrot"}} """, "nb": """ - Vel, det er egg og bacon, - Eggepølse og bacon - Egg og spam - Egg, bacon og spam - Egg, bacon, pølse og spam - Spam, bacon, pølse og spam - Spam, egg, spam, spam, bacon og spam - Spam, pølse, spam, spam, spam, bacon, spam tomat og spam - Spam, spam, spam, egg og spam - Spam, spam, spam, spam, spam, spam, baked beans, spam, spam, spam og spam. + {{filename="/images/Monty_python_foot.png" description="Av Agnolo Bronzino – Bronzino's Venus, Cupid, Folly and Time, authored by User:Husky., Offentlig eiendom, https://commons.wikimedia.org/w/index.php?curid=3595935"}} + Modellen er en referansemodell for utviklere, som viser beste praksis for modellutvikling. + Det er en enkel dagsgradsmodell for et tenkt skadedyr, og når terskler passeres, utvikler advarselsstatusen seg + {{filename="/images/DeadParrot.png" description="This is a dead parrot"}} """, }