diff --git a/resources/library/search/Pixabay.wgs/index.html b/resources/library/search/Pixabay.wgs/index.html index 890b992b..7e3068b0 100644 --- a/resources/library/search/Pixabay.wgs/index.html +++ b/resources/library/search/Pixabay.wgs/index.html @@ -38,7 +38,7 @@ var searchLanguage = "en"; // Language for the widget - var locale = "en"; + var locale = locales["en"]; // Fetch 960px images instead of the default 640px. However the API doesn't // provide size information in this case, so it is disabled by default. @@ -176,7 +176,8 @@ // Loop through our results, printing them to the page. var results = json.hits; - //TODO: display a message on page when there are zero results. Would require locales, ideally + if (results.length == 0) + $("

"+locale.no_result+"

").appendTo(contentDiv); for (var i = 0; i < results.length; i++) { var result = results[i]; diff --git a/resources/library/search/Pixabay.wgs/locales/locales.js b/resources/library/search/Pixabay.wgs/locales/locales.js index b21dc8ec..91ef66be 100755 --- a/resources/library/search/Pixabay.wgs/locales/locales.js +++ b/resources/library/search/Pixabay.wgs/locales/locales.js @@ -38,7 +38,8 @@ var locales = { 'image_license_comm_reuse': 'Commercial reuse', 'image_license_modif': 'Modification', 'image_license_comm_modif': 'Commercial modification', - 'disclaimer_title': 'Pixabay image search' + 'disclaimer_title': 'Pixabay image search', + 'no_result': 'No result' }, 'fr': { 'def_opts_val_size': 'Toutes', @@ -79,6 +80,7 @@ var locales = { 'image_license_comm_reuse': 'Usage, distribution, commercial', 'image_license_modif': 'Usage, distribution, modification', 'image_license_comm_modif': 'Usage, distribution, modification, commercial', - 'disclaimer_title': 'Recherche d\'images sur Pixabay' + 'disclaimer_title': 'Recherche d\'images sur Pixabay', + 'no_result': 'Aucun résultat' } };