Skip to content

Commit

Permalink
Merge branch 'master' into finsih-ingredient-game
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored Feb 11, 2024
2 parents 4d29ffa + 76e7059 commit 56b7a20
Show file tree
Hide file tree
Showing 17 changed files with 405 additions and 318 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-assign-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v2.0.1
- uses: toshimaru/auto-author-assign@v2.1.0
2 changes: 1 addition & 1 deletion .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: Sync Crowdin translations
uses: crowdin/github-action@v1.15.2
uses: crowdin/github-action@v1.17.0
with:
upload_translations: false # default is false
# Use this option to upload translations for a single specified language
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: "Dependency Review"
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
run: yarn deploy

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: "dist"

- name: Deploy to github pages 🚀
if: github.ref == 'refs/heads/master'
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
- uses: GoogleCloudPlatform/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
16 changes: 16 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@ pull_request_title: "feat: New translations for Hunger Games"
files:
- source: /src/i18n/common.json
translation: /src/i18n/%two_letters_code%.json
languages_mapping:
two_letters_code:
pt-BR: pt_BR
pt-PT: pt
zh-CN: zh
zh-HK: zh_HK
en-GB: en_GB
en-AU: en_AU
en-US: en_US
nl-BE: nl_BE
nl: nl
zh-TW: zh_TW
sr-CS: sr_CS
sr: sr_RS
ku : kmr_TR
kmr: kmr
28 changes: 28 additions & 0 deletions src/components/QuestionFilter/useFavorite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from "react";
import { localFavorites } from "../../localeStorageManager";

export const useFavorite = (filterState: any): [boolean, () => void] => {
const [isFavorite, setIsFavorite] = React.useState(
localFavorites.isSaved(filterState),
);

React.useEffect(() => {
setIsFavorite(localFavorites.isSaved(filterState));
}, [filterState]);

const toggleFavorite = React.useCallback(
(imageSrc = "", title = "") => {
const isSaved = localFavorites.isSaved(filterState);

if (isSaved) {
localFavorites.removeQuestion(filterState);
} else {
localFavorites.addQuestion(filterState, imageSrc, title);
}

setIsFavorite(!isSaved);
},
[filterState],
);
return [isFavorite, toggleFavorite];
};
5 changes: 4 additions & 1 deletion src/hooks/useUrlParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export const convertObjectParamsToUrlParams = (
const urlParams = new URLSearchParams(window.location.search);

Object.keys(parameters).forEach((key) => {
if (JSON.stringify(parameters[key]) !== urlParams.get(key)) {
if (
JSON.stringify(parameters[key]) !== urlParams.get(key) &&
parameters[key] !== ""
) {
urlParams.set(key, parameters[key]);
}
});
Expand Down
32 changes: 16 additions & 16 deletions src/i18n/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"thank_you": "Thank you for helping us improve Open Food Facts so that more people can use it easily."
},
"statistics": {
"title": "{{userName}} statistics:",
"title": "{{userName}} statistika:",
"editorCount": {
"title": "Editor",
"title": "Redaktor",
"description": "Number of editions done"
},
"contributorCount": {
Expand All @@ -47,7 +47,7 @@
},
"flagged_images": {
"title": "Images flagged by users",
"loading": "Loading"
"loading": "Laadimine"
},
"questions": {
"category": "kategooria",
Expand Down Expand Up @@ -94,7 +94,7 @@
"brand": "Toote kaubamärk",
"popularity": "Sordi populaarsuse alusel",
"edit": "",
"campaign": "Campaign"
"campaign": "Kampaania"
},
"placeholders": {
"value": "Value (Fanta, en:organic,...)",
Expand All @@ -103,12 +103,12 @@
},
"actions": {
"edit": "Edit Filters",
"cancel": "Cancel",
"cancel": "Tühista",
"apply": "Rakenda"
}
},
"other_questions": "Other questions",
"send": "Send",
"send": "Saada",
"flag": "Something wrong? Report/flag the image!",
"unflag": "Unflag the image",
"reset_filters": "Reset filters",
Expand All @@ -119,15 +119,15 @@
"please_wait_while_we_fetch_the_question": "Please wait while we fetch the question!"
},
"menu": {
"title": "Hunger Games",
"games": "Games",
"title": "Näljamängud",
"games": "Mängud",
"questions": "Küsimused",
"logos": "Logos",
"logos-annotation": "Logos annotation",
"logos-search": "Logos search",
"logos-product-search": "Annotation per products",
"logos-deep-search": "Infinite annotation",
"manage": "Manage",
"manage": "Halda",
"insights": "Insights",
"nutritions": "Nutrition facts",
"settings": "Seaded",
Expand Down Expand Up @@ -162,7 +162,7 @@
"value": "Value",
"created_at": "Created at",
"completed_at": "Completed at",
"automatic": "Automatic",
"automatic": "Automaatne",
"human_required": "Human required",
"edit_product": "Open product edit",
"view_product": "Open product page",
Expand All @@ -179,7 +179,7 @@
"submit": "Salvesta",
"type": "Type",
"label": "Silt",
"brand": "Brand",
"brand": "Kaubamärk",
"packager_code": "Pakendaja kood",
"packaging": "Packaging",
"qr_code": "QR kood",
Expand Down Expand Up @@ -214,7 +214,7 @@
"description": "Select a logo you want to look for, and let's go to catch them all. For every logo you annotate, we will fetch it's neighbors such that you might never stop to annotate. (Press Shift to select range of logos)",
"ref_logos": "Reference logos (logo already annotated with this value)",
"remaining": "Remaining to annotate",
"select_all": "Select All",
"select_all": "Vali kõik",
"unselect_all": "Deselect All"
}
},
Expand Down Expand Up @@ -340,13 +340,13 @@
"nutriments": {
"nutriment_energy-kj": "Energy (kJ)",
"nutriment_energy-kcal": "Energy (kCal)",
"nutriment_fat": "Fat",
"nutriment_saturated-fat": "Küllastunud rasva",
"nutriment_carbohydrates": "Carbohydrates",
"nutriment_fat": "Rasvad",
"nutriment_saturated-fat": "Küllastunud rasvhapped",
"nutriment_carbohydrates": "Süsivesikud",
"nutriment_sugars": "Sugar",
"nutriment_proteins": "Protein content",
"nutriment_fiber": "Fibres",
"nutriment_salt": "Soola",
"nutriment_salt": "Sool",
"nutriment_sodium": "Sodium"
},
"history": {
Expand Down
108 changes: 54 additions & 54 deletions src/i18n/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@
"title": "{{userName}} statistics:",
"editorCount": {
"title": "Editor",
"description": "Number of editions done"
"description": "किये गये संस्करणों की संख्या"
},
"contributorCount": {
"title": "सहयोगी",
"description": "Adding a new product"
"description": "एक नया उत्पाद जोड़ना"
},
"photographerCount": {
"title": "Photographer",
"description": "Taking photos for a product"
"title": "फ़ोटोग्राफ़र",
"description": "किसी उत्पाद के लिए फ़ोटो लेना"
}
}
},
"flagged_images": {
"title": "Images flagged by users",
"loading": "Loading"
"title": "उपयोगकर्ताओं द्वारा चिह्नित छवियाँ",
"loading": "लोड हो रहा है"
},
"questions": {
"category": "वर्ग",
Expand All @@ -58,75 +58,75 @@
"brands": "ब्रांड",
"packaging": "पैकेजिंग",
"quantity": "मात्रा",
"insightTypeLabel": "Only shows",
"insightTypeLabel": "केवल दिखाता है",
"ingredients": "सामग्री",
"product_weight": "product weight",
"popularity_sort": "Sort by popularity",
"see_examples": "See examples of this ",
"popularity_sort": "लोकप्रियता के आधार पर क्रमबद्ध करें",
"see_examples": "इसके उदाहरण देखें ",
"no": "नहीं",
"skip": "Skip",
"skip": "स्किप करें",
"yes": "हाँ",
"no_questions_remaining": "No questions remaining",
"countries": "Countries",
"view": "View",
"no_questions_remaining": "कोई प्रश्न शेष नहीं",
"countries": "देशों",
"view": "देखें",
"edit": "संपादित करें",
"hide_images": "Hide images (faster loading)",
"display_images": "Display images",
"annotations": "Annotations",
"last_annotations": "Last annotations",
"remaining_annotations": "Remaining questions",
"hide_images": "छवियाँ छिपाएँ (तेजी से लोड हो रहा है)",
"display_images": "छवियाँ प्रदर्शित करें",
"annotations": "एनोटेशन",
"last_annotations": "अंतिम टिप्पणियाँ",
"remaining_annotations": "शेष प्रश्न",
"annotated_annotations": "Annotated",
"filters": {
"active_filter_number": "+{{count}} filters",
"active_filter_number_one": "+{{count}} filter",
"active_filter_number_zero": "no filter",
"active_filter_number": "+{{count}} फिल्टर",
"active_filter_number_one": "+{{count}} फिल्टर",
"active_filter_number_zero": "कोई फिल्टर नहीं",
"short_label": {
"value": "value",
"value": "मूल्य",
"country": "देश",
"brand": "ब्रांड",
"popularity": "popularity",
"campaign": "camp"
"popularity": "लोकप्रियता",
"campaign": "शिविर"
},
"long_label": {
"type": "Question Type",
"value": "Proposed Value",
"country": "Product Country",
"brand": "Product Brand",
"popularity": "Sort by popularity",
"type": "प्रश्न प्रकार",
"value": "प्रस्तावित मूल्य",
"country": "उत्पाद देश",
"brand": "उत्पाद का ब्रांड",
"popularity": "लोकप्रियता के आधार पर क्रमबद्ध करें",
"edit": "",
"campaign": "Campaign"
"campaign": "अभियान"
},
"placeholders": {
"value": "Value (Fanta, en:organic,...)",
"brand": "Auchan, Danone, Herta, ...",
"campaign": "Annotation campaigns"
"value": "मूल्य (फैंटा, एन:ऑर्गेनिक,...)",
"brand": "औचन, डैनोन, हर्टा, ...",
"campaign": "टिप्पणि अभियान"
},
"actions": {
"edit": "Edit Filters",
"cancel": "Cancel",
"apply": "Apply"
"edit": "फ़िल्टर संपादित करें",
"cancel": "रद्द करें",
"apply": "लागू करें"
}
},
"other_questions": "Other questions",
"send": "Send",
"flag": "Something wrong? Report/flag the image!",
"unflag": "Unflag the image",
"reset_filters": "Reset filters",
"other_questions": "अन्य सवाल",
"send": "भेजें",
"flag": "कुछ गड़बड़ है क्या? छवि की रिपोर्ट करें/ध्वजांकित करें!",
"unflag": "छवि को अनफ़्लैग करें",
"reset_filters": "फ़िल्टर रीसेट करें",
"log_in": "उपयोगकर्ता नाम",
"sign_up": "साइन अप करें",
"login_title": "Make your annotation count",
"login_description": "You are not currently logged into Open Food Facts. To get your answers directly applied to products, and associated to your account, consider logging in to your Open Food Facts account, or creating one",
"please_wait_while_we_fetch_the_question": "Please wait while we fetch the question!"
"login_title": "अपने टिप्पणि को गिनें",
"login_description": "आप वर्तमान में ओपन फ़ूड फैक्ट्स में लॉग इन नहीं हैं। अपने उत्तरों को सीधे उत्पादों पर लागू करने और अपने खाते से संबद्ध करने के लिए, अपने ओपन फ़ूड फैक्ट्स खाते में लॉग इन करने या एक खाता बनाने पर विचार करें",
"please_wait_while_we_fetch_the_question": "कृपया तब तक प्रतीक्षा करें जब तक हम प्रश्न प्राप्त न कर लें!"
},
"menu": {
"title": "Hunger Games",
"games": "Games",
"games": "खेल",
"questions": "Questions",
"logos": "Logos",
"logos-annotation": "Logos annotation",
"logos-search": "Logos search",
"logos-product-search": "Annotation per products",
"logos-deep-search": "Infinite annotation",
"logos-annotation": "लोगो टिप्पणि",
"logos-search": "लोगो खोजें",
"logos-product-search": "प्रति उत्पाद एनोटेशन",
"logos-deep-search": "अनंत व्याख्या",
"manage": "Manage",
"insights": "Insights",
"nutritions": "पोषण तथ्य",
Expand Down Expand Up @@ -198,15 +198,15 @@
"loading": "लोड किया जा रहा है…",
"refresh": "Refresh",
"search_specific": "Search specific logo",
"load_more": "Load more",
"load_more": "अधिक लोड करें",
"no_results": "No logo found",
"result_count": "Shows {{showing}} on {{available}} available",
"flag": "Something wrong? Report/flag the image!",
"unflag": "Unflag the image",
"flag": "कुछ गड़बड़ है क्या? छवि की रिपोर्ट करें/ध्वजांकित करें!",
"unflag": "छवि को अनफ़्लैग करें",
"crop_image_title": "crop of the logo",
"no_more_questions": "No more questions about this logo. You can try to find more logos with the following game.",
"no_more_questions": "इस लोगो के बारे में कोई और प्रश्न नहीं. आप निम्नलिखित गेम के साथ अधिक लोगो ढूंढने का प्रयास कर सकते हैं।",
"loading_messages": {
"pending_reference_logos": "We are loading some logos examples to initialise the search",
"pending_reference_logos": "हम खोज आरंभ करने के लिए कुछ लोगो उदाहरण लोड कर रहे हैं",
"failed_reference_logos": "We did not find any logos with this annotation. Try to use the following game to annotate some of them."
},
"deep_search": {
Expand Down
Loading

0 comments on commit 56b7a20

Please sign in to comment.