From 9c74c0234ba919520b4b3d01cbc398a5ccd398f1 Mon Sep 17 00:00:00 2001 From: Ben Grant Date: Tue, 1 Jun 2021 19:20:23 +1000 Subject: [PATCH 1/2] Create Japanese language --- crabfit-frontend/public/i18n/ja/common.json | 58 +++++++++++++++++ crabfit-frontend/public/i18n/ja/event.json | 63 +++++++++++++++++++ crabfit-frontend/public/i18n/ja/help.json | 23 +++++++ crabfit-frontend/public/i18n/ja/home.json | 57 +++++++++++++++++ crabfit-frontend/public/i18n/ja/privacy.json | 52 +++++++++++++++ .../AvailabilityViewer/AvailabilityViewer.tsx | 2 +- crabfit-frontend/src/res/dayjs_locales.ts | 14 ++--- 7 files changed, 260 insertions(+), 9 deletions(-) create mode 100644 crabfit-frontend/public/i18n/ja/common.json create mode 100644 crabfit-frontend/public/i18n/ja/event.json create mode 100644 crabfit-frontend/public/i18n/ja/help.json create mode 100644 crabfit-frontend/public/i18n/ja/home.json create mode 100644 crabfit-frontend/public/i18n/ja/privacy.json diff --git a/crabfit-frontend/public/i18n/ja/common.json b/crabfit-frontend/public/i18n/ja/common.json new file mode 100644 index 0000000..1a612d4 --- /dev/null +++ b/crabfit-frontend/public/i18n/ja/common.json @@ -0,0 +1,58 @@ +{ + "name": "Crab Fit", + "tagline": "Create your own", + "cta": "Create your own Crab Fit!", + "created": "{{date}}で作成", + "donate": { + "info": "Thank you for using Crab Fit. If you like it, consider donating.", + "button": "Donate", + "title": "Every amount counts :)", + "options": { + "$2": "Donate $2", + "$5": "Donate $5", + "$10": "Donate $10", + "choose": "Choose an amount" + }, + "messages": { + "about": "If it's helped you out at all, consider donating to help keep it running. 🦀", + "success": "Thank you for your donation! Without you, Crab Fit wouldn't be free, so thank you and keep being super awesome!", + "error": "Cannot make donation through Google. Please try donating through the website crab.fit 🦀" + } + }, + "options": { + "name": "Options", + "weekStart": { + "label": "Week starts on", + "options": { + "Sunday": "日曜", + "Monday": "月曜" + } + }, + "timeFormat": { + "label": "Time format", + "options": { + "12h": "12時間", + "24h": "24時間" + } + }, + "theme": { + "label": "Theme", + "options": { + "System": "System", + "Light": "Light", + "Dark": "Dark" + } + }, + "highlight": { + "label": "Highlight highest availability", + "title": "Make the highest availability on the heatmap stand out", + "options": { + "Off": "Off", + "On": "On" + } + }, + "language": { + "label": "言語" + } + } +} diff --git a/crabfit-frontend/public/i18n/ja/event.json b/crabfit-frontend/public/i18n/ja/event.json new file mode 100644 index 0000000..569723a --- /dev/null +++ b/crabfit-frontend/public/i18n/ja/event.json @@ -0,0 +1,63 @@ +{ + "available": "available", + + "nav": { + "title": "Click to copy", + "copied": "Copied!", + "shareinfo": "Copy the link to this page, or share via <1>email.", + "shareinfo_alt": "Click the link above to copy it to your clipboard, or share via <1>email.", + "email_subject": "Scheduling {{event_name}}", + "email_body": "Visit this link to enter your availabilities:" + }, + "form": { + "signed_out": "Sign in to add your availability", + "signed_in": "Signed in as {{name}}", + + "name": "Your name", + "password": "Password (optional)", + "button": "Login", + "info": "These details are only for this event. Use a password to prevent others from changing your availability.", + + "timezone": "Your time zone", + + "errors": { + "password_incorrect": "Password is incorrect. Check your name is spelled right.", + "unknown": "Failed to login. Please try again." + }, + + "created_in_timezone": "This event was created in the timezone {{timezone}}. <3>Click here to use it.", + "local_timezone": "Your local timezone is detected to be {{timezone}}. <3>Click here to use it." + }, + "offline": { + "title": "You are offline", + "body": "A Crab Fit doesn't work offline.
Make sure you're connected to the internet and try again." + }, + "error": { + "title": "Event not found", + "body": "Check that the url you entered is correct." + }, + + "tabs": { + "you": "Your availability", + "you_tooltip": "Login to set your availability", + "group": "Group availability" + }, + + "group": { + "legend_tooltip": "Click to highlight highest availability", + "info1": "Hover or tap the calendar below to see who is available", + "info2": "Click the names below to view people individually" + }, + + "you": { + "info": "Click and drag the calendar below to set your availabilities", + "google_cal": { + "login": "Sync with Google Calendar", + "logout": "log out", + "select_all": "Select all", + "select_none": "Select none", + "info": "Importing will overwrite your current availability", + "button": "Import availability" + } + } +} diff --git a/crabfit-frontend/public/i18n/ja/help.json b/crabfit-frontend/public/i18n/ja/help.json new file mode 100644 index 0000000..4d0f1c7 --- /dev/null +++ b/crabfit-frontend/public/i18n/ja/help.json @@ -0,0 +1,23 @@ +{ + "name": "How to Crab Fit", + + "p1": "Crab Fit is a tool that helps you when planning events with friends or coworkers. You just create an event, enter your availability, send it out, and see when everyone is free!", + "p2": "See below for detailed steps of how to Crab Fit your event.", + + "s1": "Step 1", + + "p3": "Use the form at <1>crab.fit to make a new event. You only need to put in the rough time period for when your event occurs here, not your availability.", + "p4": "For example, we'll use \"Jenny's Birthday Lunch\". Jenny wants her birthday lunch to happen on the same week as her birthday, the 15th of April, but she knows that not all of her friends are available on the 15th. She also doesn't want to do it on the weekend.", + "p5": "Jenny also knows that since it's a lunch event, it can't start before 11am or go any later than 5pm.", + + "s2": "Step 2", + + "p6": "Enter your availability for the event you just created.", + "p7": "In our example, Jenny now puts in her availability for her birthday lunch. She is free all week, except after 3pm on Tuesday and Wednesday, and before 1pm on Friday.", + + "s3": "Step 3", + + "p8": "Send the link to everyone you want to come.", + "p9": "After Jenny has sent the link to her friends and waited for them to also fill out their availabilities, she can now easily see them all on the heatmap below and choose the darkest area for a time that suits everyone!", + "p10": "In this example, 1pm to 3pm on Friday the 16th works for all Jenny's friends." +} diff --git a/crabfit-frontend/public/i18n/ja/home.json b/crabfit-frontend/public/i18n/ja/home.json new file mode 100644 index 0000000..6a2b766 --- /dev/null +++ b/crabfit-frontend/public/i18n/ja/home.json @@ -0,0 +1,57 @@ +{ + "create": "CREATE A", + "recently_visited": "Recently visited", + "nav": { + "about": "About", + "donate": "Donate" + }, + "form": { + "name": { + "label": "Give your event a name!", + "sublabel": "Or leave blank to generate one" + }, + "dates": { + "label": "What dates might work?", + "sublabel": "Click and drag to select", + "options": { + "specific": "Specific dates", + "week": "Days of the week" + }, + "tooltips": { + "previous": "先月", + "next": "来月", + "today": "今日" + } + }, + "times": { + "label": "What times might work?", + "sublabel": "Click and drag to select a time range" + }, + "timezone": { + "label": "And the timezone", + "defaultOption": "Select..." + }, + + "button": "Create", + "errors": { + "no_dates": "There aren't any dates selected", + "same_times": "The start and end times can't be the same", + "no_time": "There isn't any time selected", + "unknown": "Something went wrong. Please try again later." + } + }, + "offline": "You can't create a Crab Fit when you don't have an internet connection. Please make sure you're connected.", + + "about": { + "name": "About Crab Fit", + "events": "Events created", + "availabilities": "Availabilities entered", + "content": { + "p1": "Crab Fit helps you fit your event around everyone's schedules. Simply create an event above and send the link to everyone that is participating. Results update live and you will be able to see a heat-map of when everyone is free.<1/><2>Learn more about how to Crab Fit.", + "p2": "Create a lot of Crab Fits? Get the <1>Chrome extension or <3>Firefox extension for your browser! You can also download the <5>Android app to Crab Fit on the go.", + "p3": "Created by <1>Ben Grant, Crab Fit is the modern-day solution to your group event planning debates.", + "p4": "The code for Crab Fit is open source, if you find any issues or want to contribute, you can visit the <1>repository. By using Crab Fit you agree to the <3>privacy policy.", + "p5": "Consider donating below if it helped you out so it can stay free for everyone. 🦀" + } + } +} diff --git a/crabfit-frontend/public/i18n/ja/privacy.json b/crabfit-frontend/public/i18n/ja/privacy.json new file mode 100644 index 0000000..0f7f917 --- /dev/null +++ b/crabfit-frontend/public/i18n/ja/privacy.json @@ -0,0 +1,52 @@ +{ + "name": "Privacy Policy", + + "p1": "This SERVICE is provided by Benjamin Grant at no cost and is intended for use as is.", + "p2": "This page is used to inform visitors regarding the policies of the collection, use, and disclosure of Personal Information if using the Service.", + "p3": "If you choose to use the Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that is collected is used for providing and improving the Service. Your information will not be used or shared with anyone except as described in this Privacy Policy.", + + "h1": "Information Collection and Use", + + "p4": "The Service uses third party services that may collect information used to identify you.", + "p5": "Links to privacy policies of the third party service providers used by the Service:", + "link": "Google Play Services", + + "h2": "Log Data", + + "p6": "When you use the Service, in the case of an error, data and information is collected to improve the Service, which may include your IP address, device name, operating system version, app configuration and the time and date of the error.", + + "h3": "Cookies", + + "p7": "Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.", + "p8": "Cookies are used by Google Analytics to track you across the web and provide anonymous statistics to improve the Service.", + + "h4": "Service Providers", + + "p9": "Third-party companies may be employed for the following reasons:", + "l1": "To facilitate the Service", + "l2": "To provide the Service on our behalf", + "l3": "To perform Service-related services", + "l4": "To assist in analyzing how the Service is used", + "p10": "To perform these tasks, the third parties may have access to your Personal Information, but are obligated not to disclose or use this information for any purpose except the above.", + + "h5": "Security", + + "p11": "Personal Information that is shared via the Service is protected, however remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, so take care when sharing Personal Information.", + + "h6": "Links to Other Sites", + + "p12": "The Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by the Service. Therefore, you are advised to review the Privacy Policy of these websites.", + + "h7": "Children's Privacy", + + "p13": "The Service does not address anyone under the age of 13. Personally identifiable information is not knowingly collected from children under 13. If discovered that a child under 13 has provided the Service with personal information, such information will be immediately deleted from the servers. If you are a parent or guardian and you are aware that your child has provided the Service with personal information, please <1>contact us so that this information can be removed.", + + "h8": "Changes to This Privacy Policy", + + "p14": "This Privacy Policy may be updated from time to time. Thus, you are advised to review this page periodically for any changes.", + "p15": "This policy is effective as of 2021-04-20", + + "h9": "Contact Us", + + "p16": "If you have any questions or suggestions about the Privacy Policy, do not hesitate to contact us at <1>benjamin.grantGRA0007+crabfit@gmail.com." +} diff --git a/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.tsx b/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.tsx index 4597830..796aa8c 100644 --- a/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.tsx +++ b/crabfit-frontend/src/components/AvailabilityViewer/AvailabilityViewer.tsx @@ -112,7 +112,7 @@ const AvailabilityViewer = ({ onMouseEnter={(e) => { const cellBox = e.currentTarget.getBoundingClientRect(); const wrapperBox = wrapper?.current?.getBoundingClientRect() ?? { x: 0, y: 0 }; - const timeText = timeFormat === '12h' ? `h${locales[locale].separator}mma` : `HH${locales[locale].separator}mm`; + const timeText = timeFormat === '12h' ? `h${locales[locale].separator ?? ':'}mma` : `HH${locales[locale].separator ?? ':'}mm`; setTooltip({ x: Math.round(cellBox.x-wrapperBox.x + cellBox.width/2), y: Math.round(cellBox.y-wrapperBox.y + cellBox.height)+6, diff --git a/crabfit-frontend/src/res/dayjs_locales.ts b/crabfit-frontend/src/res/dayjs_locales.ts index c5d1d90..5a13523 100644 --- a/crabfit-frontend/src/res/dayjs_locales.ts +++ b/crabfit-frontend/src/res/dayjs_locales.ts @@ -4,42 +4,36 @@ const locales = { import: () => import('dayjs/locale/de'), weekStart: 1, timeFormat: '24h', - separator: ':', }, 'en': { // English (US) name: 'English (US)', import: () => import('dayjs/locale/en'), weekStart: 0, timeFormat: '12h', - separator: ':', }, 'en-GB': { // English (UK) name: 'English (UK)', import: () => import('dayjs/locale/en-gb'), weekStart: 1, timeFormat: '12h', - separator: ':', }, 'es': { // Spanish name: 'Español', import: () => import('dayjs/locale/es'), weekStart: 1, timeFormat: '24h', - separator: ':', }, 'fr': { // French name: 'Français', import: () => import('dayjs/locale/fr'), weekStart: 1, timeFormat: '24h', - separator: ':', }, 'hi': { // Hindi name: 'हिंदी', import: () => import('dayjs/locale/hi'), weekStart: 1, timeFormat: '12h', - separator: ':', }, 'id': { // Indonesian name: 'Indonesia', @@ -48,19 +42,23 @@ const locales = { timeFormat: '24h', separator: '.', }, + 'ja': { // Japanese + name: '日本語', + import: () => import('dayjs/locale/ja'), + weekStart: 0, + timeFormat: '12h', + }, 'ko': { // Korean name: '한국어', import: () => import('dayjs/locale/ko'), weekStart: 0, timeFormat: '24h', - separator: ':', }, 'ru': { // Russian name: 'Pусский', import: () => import('dayjs/locale/ru'), weekStart: 1, timeFormat: '24h', - separator: ':', }, }; From f08b8a8d1a1fb9bca2af60e9e23c697981ac7247 Mon Sep 17 00:00:00 2001 From: Ben Grant Date: Tue, 1 Jun 2021 20:07:07 +1000 Subject: [PATCH 2/2] Settings translations --- crabfit-frontend/public/i18n/ja/common.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crabfit-frontend/public/i18n/ja/common.json b/crabfit-frontend/public/i18n/ja/common.json index 1a612d4..7086ea1 100644 --- a/crabfit-frontend/public/i18n/ja/common.json +++ b/crabfit-frontend/public/i18n/ja/common.json @@ -36,19 +36,19 @@ } }, "theme": { - "label": "Theme", + "label": "色のテーマ", "options": { - "System": "System", - "Light": "Light", - "Dark": "Dark" + "System": "システム", + "Light": "明色", + "Dark": "暗色" } }, "highlight": { "label": "Highlight highest availability", "title": "Make the highest availability on the heatmap stand out", "options": { - "Off": "Off", - "On": "On" + "Off": "オフ", + "On": "オン" } }, "language": {