Merge branch 'i18n-ci' into 'develop'

GitLab CI: fail the CI if en.json isn't updated with the codebase

See merge request soapbox-pub/soapbox!2053
This commit is contained in:
Alex Gleason 2022-12-30 00:22:02 +00:00
commit a8f05c2bb9
6 changed files with 211 additions and 6993 deletions

View File

@ -94,7 +94,12 @@ nginx-test:
build-production:
stage: test
script: yarn build
script:
- yarn build
- yarn manage:translations en
# Fail if files got changed.
# https://stackoverflow.com/a/9066385
- git diff --quiet
variables:
NODE_ENV: production
artifacts:
@ -116,17 +121,6 @@ docs-deploy:
- "docs/**/*"
interruptible: true
# Supposed to fail when translations are outdated, instead always passes
#
# i18n:
# stage: build
# script: yarn manage:translations
# variables:
# NODE_ENV: development
# before_script:
# - yarn
# - yarn build
review:
stage: deploy
environment:

File diff suppressed because it is too large Load Diff

View File

@ -110,12 +110,15 @@
"admin.reports.empty_message": "There are no open reports. If a user gets reported, they will show up here.",
"admin.reports.report_closed_message": "Report on @{name} was closed",
"admin.reports.report_title": "Report on {acct}",
"admin.software.backend": "Backend",
"admin.software.frontend": "Frontend",
"admin.statuses.actions.delete_status": "Delete post",
"admin.statuses.actions.mark_status_not_sensitive": "Mark post not sensitive",
"admin.statuses.actions.mark_status_sensitive": "Mark post sensitive",
"admin.statuses.status_deleted_message": "Post by @{acct} was deleted",
"admin.statuses.status_marked_message_not_sensitive": "Post by @{acct} was marked not sensitive",
"admin.statuses.status_marked_message_sensitive": "Post by @{acct} was marked sensitive",
"admin.theme.title": "Theme",
"admin.user_index.empty": "No users found.",
"admin.user_index.search_input_placeholder": "Who are you looking for?",
"admin.users.actions.deactivate_user": "Deactivate @{name}",
@ -147,7 +150,6 @@
"alert.unexpected.links.support": "Support",
"alert.unexpected.message": "Something went wrong.",
"alert.unexpected.return_home": "Return Home",
"alert.unexpected.title": "Oops!",
"aliases.account.add": "Create alias",
"aliases.account_label": "Old account:",
"aliases.aliases_list_delete": "Unlink alias",
@ -186,19 +188,78 @@
"bundle_modal_error.message": "Something went wrong while loading this modal.",
"bundle_modal_error.retry": "Try again",
"card.back.label": "Back",
"chat_box.actions.send": "Send",
"chat_box.input.placeholder": "Send a message…",
"chat_panels.main_window.empty": "No chats found. To start a chat, visit a user's profile.",
"chat_panels.main_window.title": "Chats",
"chat_window.close": "Close chat",
"chat.actions.send": "Send",
"chat.failed_to_send": "Message failed to send.",
"chat.input.placeholder": "Type a message",
"chat.page_settings.accepting_messages.label": "Allow users to start a new chat with you",
"chat.page_settings.play_sounds.label": "Play a sound when you receive a message",
"chat.page_settings.preferences": "Preferences",
"chat.page_settings.privacy": "Privacy",
"chat.page_settings.submit": "Save",
"chat.page_settings.title": "Message Settings",
"chat.retry": "Retry?",
"chat.welcome.accepting_messages.label": "Allow users to start a new chat with you",
"chat.welcome.notice": "You can change these settings later.",
"chat.welcome.submit": "Save & Continue",
"chat.welcome.subtitle": "Exchange direct messages with other users.",
"chat.welcome.title": "Welcome to {br} Chats!",
"chat_composer.unblock": "Unblock",
"chat_list_item.blocked_you": "This user has blocked you",
"chat_list_item.blocking": "You have blocked this user",
"chat_message_list.blocked": "You blocked this user",
"chat_message_list.blockedBy": "You are blocked by",
"chat_message_list.network_failure.action": "Try again",
"chat_message_list.network_failure.subtitle": "We encountered a network failure.",
"chat_message_list.network_failure.title": "Whoops!",
"chat_message_list_intro.actions.accept": "Accept",
"chat_message_list_intro.actions.leave_chat": "Leave chat",
"chat_message_list_intro.actions.message_lifespan": "Messages older than {day} days are deleted.",
"chat_message_list_intro.actions.report": "Report",
"chat_message_list_intro.intro": "wants to start a chat with you",
"chat_message_list_intro.leave_chat.confirm": "Leave Chat",
"chat_message_list_intro.leave_chat.heading": "Leave Chat",
"chat_message_list_intro.leave_chat.message": "Are you sure you want to leave this chat? Messages will be deleted for you and this chat will be removed from your inbox.",
"chat_search.blankslate.body": "Search for someone to chat with.",
"chat_search.blankslate.title": "Start a chat",
"chat_search.empty_results_blankslate.action": "Message someone",
"chat_search.empty_results_blankslate.body": "Try searching for another name.",
"chat_search.empty_results_blankslate.title": "No matches found",
"chat_search.title": "Messages",
"chat_settings.auto_delete.14days": "14 days",
"chat_settings.auto_delete.2minutes": "2 minutes",
"chat_settings.auto_delete.30days": "30 days",
"chat_settings.auto_delete.7days": "7 days",
"chat_settings.auto_delete.90days": "90 days",
"chat_settings.auto_delete.days": "{day} days",
"chat_settings.auto_delete.hint": "Sent messages will auto-delete after the time period selected",
"chat_settings.auto_delete.label": "Auto-delete messages",
"chat_settings.block.confirm": "Block",
"chat_settings.block.heading": "Block @{acct}",
"chat_settings.block.message": "Blocking will prevent this profile from direct messaging you and viewing your content. You can unblock later.",
"chat_settings.leave.confirm": "Leave Chat",
"chat_settings.leave.heading": "Leave Chat",
"chat_settings.leave.message": "Are you sure you want to leave this chat? Messages will be deleted for you and this chat will be removed from your inbox.",
"chat_settings.options.block_user": "Block @{acct}",
"chat_settings.options.leave_chat": "Leave Chat",
"chat_settings.options.report_user": "Report @{acct}",
"chat_settings.options.unblock_user": "Unblock @{acct}",
"chat_settings.title": "Chat Details",
"chat_settings.unblock.confirm": "Unblock",
"chat_settings.unblock.heading": "Unblock @{acct}",
"chat_settings.unblock.message": "Unblocking will allow this profile to direct message you and view your content.",
"chat_window.auto_delete_label": "Auto-delete after {day} days",
"chat_window.auto_delete_tooltip": "Chat messages are set to auto-delete after {day} days upon sending.",
"chats.actions.copy": "Copy",
"chats.actions.delete": "Delete message",
"chats.actions.deleteForMe": "Delete for me",
"chats.actions.more": "More",
"chats.actions.report": "Report user",
"chats.attachment": "Attachment",
"chats.attachment_image": "Image",
"chats.audio_toggle_off": "Audio notification off",
"chats.audio_toggle_on": "Audio notification on",
"chats.dividers.today": "Today",
"chats.main.blankslate.new_chat": "Message someone",
"chats.main.blankslate.subtitle": "Search for someone to chat with",
"chats.main.blankslate.title": "No messages yet",
"chats.main.blankslate_with_chats.subtitle": "Select from one of your open chats or create a new message.",
"chats.main.blankslate_with_chats.title": "Select a chat",
"chats.search_placeholder": "Start a chat with…",
"column.admin.awaiting_approval": "Awaiting Approval",
"column.admin.dashboard": "Dashboard",
@ -226,6 +287,9 @@
"column.directory": "Browse profiles",
"column.domain_blocks": "Hidden domains",
"column.edit_profile": "Edit profile",
"column.event_map": "Event location",
"column.event_participants": "Event participants",
"column.events": "Events",
"column.export_data": "Export data",
"column.familiar_followers": "People you know following {name}",
"column.favourited_statuses": "Liked posts",
@ -268,15 +332,14 @@
"column.pins": "Pinned posts",
"column.preferences": "Preferences",
"column.public": "Federated timeline",
"column.quotes": "Post quotes",
"column.reactions": "Reactions",
"column.reblogs": "Reposts",
"column.remote": "Federated timeline",
"column.scheduled_statuses": "Scheduled Posts",
"column.search": "Search",
"column.settings_store": "Settings store",
"column.soapbox_config": "Soapbox config",
"column.test": "Test timeline",
"column_back_button.label": "Back",
"column_forbidden.body": "You do not have permission to access this page.",
"column_forbidden.title": "Forbidden",
"common.cancel": "Cancel",
@ -286,7 +349,33 @@
"compose.edit_success": "Your post was edited",
"compose.invalid_schedule": "You must schedule a post at least 5 minutes out.",
"compose.submit_success": "Your post was sent!",
"compose_event.create": "Create",
"compose_event.edit_success": "Your event was edited",
"compose_event.fields.approval_required": "I want to approve participation requests manually",
"compose_event.fields.banner_label": "Event banner",
"compose_event.fields.description_hint": "Markdown syntax is supported",
"compose_event.fields.description_label": "Event description",
"compose_event.fields.description_placeholder": "Description",
"compose_event.fields.end_time_label": "Event end date",
"compose_event.fields.end_time_placeholder": "Event ends on…",
"compose_event.fields.has_end_time": "The event has end date",
"compose_event.fields.location_label": "Event location",
"compose_event.fields.name_label": "Event name",
"compose_event.fields.name_placeholder": "Name",
"compose_event.fields.start_time_label": "Event start date",
"compose_event.fields.start_time_placeholder": "Event begins on…",
"compose_event.participation_requests.authorize": "Authorize",
"compose_event.participation_requests.authorize_success": "User accepted",
"compose_event.participation_requests.reject": "Reject",
"compose_event.participation_requests.reject_success": "User rejected",
"compose_event.reset_location": "Reset location",
"compose_event.submit_success": "Your event was created",
"compose_event.tabs.edit": "Edit details",
"compose_event.tabs.pending": "Manage requests",
"compose_event.update": "Update",
"compose_event.upload_banner": "Upload event banner",
"compose_form.direct_message_warning": "This post will only be sent to the mentioned users.",
"compose_form.event_placeholder": "Post to this event",
"compose_form.hashtag_warning": "This post won't be listed under any hashtag as it is unlisted. Only public posts can be searched by hashtag.",
"compose_form.lock_disclaimer": "Your account is not {locked}. Anyone can follow you to view your follower-only posts.",
"compose_form.lock_disclaimer.lock": "locked",
@ -342,15 +431,22 @@
"confirmations.cancel_editing.confirm": "Cancel editing",
"confirmations.cancel_editing.heading": "Cancel post editing",
"confirmations.cancel_editing.message": "Are you sure you want to cancel editing this post? All changes will be lost.",
"confirmations.cancel_event_editing.heading": "Cancel event editing",
"confirmations.cancel_event_editing.message": "Are you sure you want to cancel editing this event? All changes will be lost.",
"confirmations.delete.confirm": "Delete",
"confirmations.delete.heading": "Delete post",
"confirmations.delete.message": "Are you sure you want to delete this post?",
"confirmations.delete_event.confirm": "Delete",
"confirmations.delete_event.heading": "Delete event",
"confirmations.delete_event.message": "Are you sure you want to delete this event?",
"confirmations.delete_list.confirm": "Delete",
"confirmations.delete_list.heading": "Delete list",
"confirmations.delete_list.message": "Are you sure you want to permanently delete this list?",
"confirmations.domain_block.confirm": "Hide entire domain",
"confirmations.domain_block.heading": "Block {domain}",
"confirmations.domain_block.message": "Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable. You will not see content from that domain in any public timelines or your notifications.",
"confirmations.leave_event.confirm": "Leave event",
"confirmations.leave_event.message": "If you want to rejoin the event, the request will be manually reviewed again. Are you sure you want to proceed?",
"confirmations.mute.confirm": "Mute",
"confirmations.mute.heading": "Mute @{name}",
"confirmations.mute.message": "Are you sure you want to mute {name}?",
@ -400,6 +496,7 @@
"developers.navigation.network_error_label": "Network error",
"developers.navigation.service_worker_label": "Service Worker",
"developers.navigation.settings_store_label": "Settings store",
"developers.navigation.show_toast": "Trigger Toast",
"developers.navigation.test_timeline_label": "Test timeline",
"developers.settings_store.advanced": "Advanced settings",
"developers.settings_store.hint": "It is possible to directly edit your user settings here. BE CAREFUL! Editing this section can break your account, and you will only be able to recover through the API.",
@ -498,6 +595,8 @@
"empty_column.community": "The local timeline is empty. Write something publicly to get the ball rolling!",
"empty_column.direct": "You don't have any direct messages yet. When you send or receive one, it will show up here.",
"empty_column.domain_blocks": "There are no hidden domains yet.",
"empty_column.event_participant_requests": "There are no pending event participation requests.",
"empty_column.event_participants": "No one joined this event yet. When someone does, they will show up here.",
"empty_column.favourited_statuses": "You don't have any liked posts yet. When you like one, it will show up here.",
"empty_column.favourites": "No one has liked this post yet. When someone does, they will show up here.",
"empty_column.filters": "You haven't created any muted words yet.",
@ -514,12 +613,36 @@
"empty_column.notifications": "You don't have any notifications yet. Interact with others to start the conversation.",
"empty_column.notifications_filtered": "You don't have any notifications of this type yet.",
"empty_column.public": "There is nothing here! Write something publicly, or manually follow users from other servers to fill it up",
"empty_column.quotes": "This post has not been quoted yet.",
"empty_column.remote": "There is nothing here! Manually follow users from {instance} to fill it up.",
"empty_column.scheduled_statuses": "You don't have any scheduled statuses yet. When you add one, it will show up here.",
"empty_column.search.accounts": "There are no people results for \"{term}\"",
"empty_column.search.hashtags": "There are no hashtags results for \"{term}\"",
"empty_column.search.statuses": "There are no posts results for \"{term}\"",
"empty_column.test": "The test timeline is empty.",
"event.banner": "Event banner",
"event.copy": "Copy link to event",
"event.date": "Date",
"event.description": "Description",
"event.discussion.empty": "No one has commented this event yet. When someone does, they will appear here.",
"event.export_ics": "Export to your calendar",
"event.external": "View event on {domain}",
"event.join_state.accept": "Going",
"event.join_state.empty": "Participate",
"event.join_state.pending": "Pending",
"event.join_state.rejected": "Going",
"event.location": "Location",
"event.manage": "Manage",
"event.organized_by": "Organized by {name}",
"event.participants": "{count} {rawCount, plural, one {person} other {people}} going",
"event.show_on_map": "Show on map",
"event.website": "External links",
"event_map.navigate": "Navigate",
"events.create_event": "Create event",
"events.joined_events": "Joined events",
"events.joined_events.empty": "You haven't joined any event yet.",
"events.recent_events": "Recent events",
"events.recent_events.empty": "There are no public events yet.",
"export_data.actions.export": "Export",
"export_data.actions.export_blocks": "Export blocks",
"export_data.actions.export_follows": "Export follows",
@ -600,6 +723,12 @@
"intervals.full.days": "{number, plural, one {# day} other {# days}}",
"intervals.full.hours": "{number, plural, one {# hour} other {# hours}}",
"intervals.full.minutes": "{number, plural, one {# minute} other {# minutes}}",
"join_event.hint": "You can tell the organizer why do you want to participate in this event:",
"join_event.join": "Request join",
"join_event.placeholder": "Message to organizer",
"join_event.request_success": "Requested to join the event",
"join_event.success": "Joined the event",
"join_event.title": "Join event",
"keyboard_shortcuts.back": "to navigate back",
"keyboard_shortcuts.blocked": "to open blocked users list",
"keyboard_shortcuts.boost": "to repost",
@ -648,6 +777,7 @@
"lists.search": "Search among people you follow",
"lists.subheading": "Your lists",
"loading_indicator.label": "Loading…",
"location_search.placeholder": "Find an address",
"login.fields.instance_label": "Instance",
"login.fields.instance_placeholder": "example.com",
"login.fields.otp_code_hint": "Enter the two-factor code generated by your phone app or use one of your recovery codes",
@ -696,6 +826,8 @@
"missing_description_modal.text": "You have not entered a description for all attachments. Continue anyway?",
"missing_indicator.label": "Not found",
"missing_indicator.sublabel": "This resource could not be found",
"modals.policy.submit": "Accept & Continue",
"modals.policy.updateTitle": "Youve scored the latest version of {siteTitle}! Take a moment to review the exciting new things weve been working on.",
"moderation_overlay.contact": "Contact",
"moderation_overlay.hide": "Hide content",
"moderation_overlay.show": "Show Content",
@ -722,8 +854,10 @@
"navigation_bar.compose": "Compose a post",
"navigation_bar.compose_direct": "Direct message",
"navigation_bar.compose_edit": "Edit post",
"navigation_bar.compose_event": "Manage event",
"navigation_bar.compose_quote": "Quote post",
"navigation_bar.compose_reply": "Reply to post",
"navigation_bar.create_event": "Create new event",
"navigation_bar.domain_blocks": "Domain blocks",
"navigation_bar.favourites": "Likes",
"navigation_bar.filters": "Filters",
@ -746,6 +880,9 @@
"notification.others": " + {count} {count, plural, one {other} other {others}}",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.pleroma:emoji_reaction": "{name} reacted to your post",
"notification.pleroma:event_reminder": "An event you are participating in starts soon",
"notification.pleroma:participation_accepted": "You were accepted to join the event",
"notification.pleroma:participation_request": "{name} wants to join your event",
"notification.poll": "A poll you have voted in has ended",
"notification.reblog": "{name} reposted your post",
"notification.status": "{name} just posted",
@ -819,6 +956,8 @@
"preferences.fields.content_type_label": "Default post format",
"preferences.fields.delete_modal_label": "Show confirmation dialog before deleting a post",
"preferences.fields.demetricator_label": "Use Demetricator",
"preferences.fields.demo_hint": "Use the default Soapbox logo and color scheme. Useful for taking screenshots.",
"preferences.fields.demo_label": "Demo mode",
"preferences.fields.display_media.default": "Hide posts marked as sensitive",
"preferences.fields.display_media.hide_all": "Always hide posts",
"preferences.fields.display_media.show_all": "Always show posts",
@ -834,7 +973,6 @@
"preferences.fields.underline_links_label": "Always underline links in posts",
"preferences.fields.unfollow_modal_label": "Show confirmation dialog before unfollowing someone",
"preferences.hints.demetricator": "Decrease social media anxiety by hiding all numbers from the site.",
"preferences.hints.feed": "In your home feed",
"preferences.notifications.advanced": "Show all notification categories",
"preferences.options.content_type_markdown": "Markdown",
"preferences.options.content_type_plaintext": "Plain text",
@ -907,6 +1045,8 @@
"remote_instance.unpin_host": "Unpin {host}",
"remote_interaction.account_placeholder": "Enter your username@domain you want to act from",
"remote_interaction.divider": "or",
"remote_interaction.event_join": "Proceed to join",
"remote_interaction.event_join_title": "Join an event remotely",
"remote_interaction.favourite": "Proceed to like",
"remote_interaction.favourite_title": "Like a post remotely",
"remote_interaction.follow": "Proceed to follow",
@ -928,6 +1068,8 @@
"reply_mentions.reply_empty": "Replying to post",
"report.block": "Block {target}",
"report.block_hint": "Do you also want to block this account?",
"report.chatMessage.context": "When reporting a users message, the five messages before and five messages after the one selected will be passed along to our moderation team for context.",
"report.chatMessage.title": "Report message",
"report.confirmation.content": "If we find that this account is violating the {link} we will take further action on the matter.",
"report.confirmation.title": "Thanks for submitting your report.",
"report.done": "Done",
@ -989,6 +1131,7 @@
"settings.configure_mfa": "Configure MFA",
"settings.delete_account": "Delete Account",
"settings.edit_profile": "Edit Profile",
"settings.messages.label": "Allow users to start a new chat with you",
"settings.other": "Other options",
"settings.preferences": "Preferences",
"settings.profile": "Profile",
@ -1016,7 +1159,6 @@
"sms_verification.sent.body": "We sent you a 6-digit code via SMS. Enter it below.",
"sms_verification.sent.header": "Verification code",
"sms_verification.success": "A verification code has been sent to your phone number.",
"toast.view": "View",
"soapbox_config.authenticated_profile_hint": "Users must be logged-in to view replies and media on user profiles.",
"soapbox_config.authenticated_profile_label": "Profiles require authentication",
"soapbox_config.copyright_footer.meta_fields.label_placeholder": "Copyright footer",
@ -1029,9 +1171,8 @@
"soapbox_config.display_fqn_label": "Display domain (eg @user@domain) for local accounts.",
"soapbox_config.feed_injection_hint": "Inject the feed with additional content, such as suggested profiles.",
"soapbox_config.feed_injection_label": "Feed injection",
"soapbox_config.fields.accent_color_label": "Accent color",
"soapbox_config.fields.brand_color_label": "Brand color",
"soapbox_config.fields.crypto_addresses_label": "Cryptocurrency addresses",
"soapbox_config.fields.edit_theme_label": "Edit theme",
"soapbox_config.fields.home_footer_fields_label": "Home footer items",
"soapbox_config.fields.logo_label": "Logo",
"soapbox_config.fields.promo_panel_fields_label": "Promo panel items",
@ -1039,6 +1180,7 @@
"soapbox_config.greentext_label": "Enable greentext support",
"soapbox_config.headings.advanced": "Advanced",
"soapbox_config.headings.cryptocurrency": "Cryptocurrency",
"soapbox_config.headings.events": "Events",
"soapbox_config.headings.navigation": "Navigation",
"soapbox_config.headings.options": "Options",
"soapbox_config.headings.theme": "Theme",
@ -1060,6 +1202,8 @@
"soapbox_config.single_user_mode_label": "Single user mode",
"soapbox_config.single_user_mode_profile_hint": "@handle",
"soapbox_config.single_user_mode_profile_label": "Main user handle",
"soapbox_config.tile_server_attribution_label": "Map tiles attribution",
"soapbox_config.tile_server_label": "Map tile server",
"soapbox_config.verified_can_edit_name_label": "Allow verified users to edit their own display name.",
"sponsored.info.message": "{siteTitle} displays ads to help fund our service.",
"sponsored.info.title": "Why am I seeing this ad?",
@ -1081,6 +1225,7 @@
"status.favourite": "Like",
"status.filtered": "Filtered",
"status.interactions.favourites": "{count, plural, one {Like} other {Likes}}",
"status.interactions.quotes": "{count, plural, one {Quote} other {Quotes}}",
"status.interactions.reblogs": "{count, plural, one {Repost} other {Reposts}}",
"status.load_more": "Load more",
"status.mention": "Mention @{name}",
@ -1139,7 +1284,6 @@
"sw.update_text": "An update is available.",
"sw.url": "Script URL",
"tabs_bar.all": "All",
"tabs_bar.chats": "Chats",
"tabs_bar.dashboard": "Dashboard",
"tabs_bar.fediverse": "Fediverse",
"tabs_bar.home": "Home",
@ -1149,6 +1293,13 @@
"tabs_bar.profile": "Profile",
"tabs_bar.search": "Search",
"tabs_bar.settings": "Settings",
"theme_editor.Reset": "Reset",
"theme_editor.export": "Export theme",
"theme_editor.import": "Import theme",
"theme_editor.import_success": "Theme was successfully imported!",
"theme_editor.restore": "Restore default theme",
"theme_editor.save": "Save theme",
"theme_editor.saved": "Theme updated!",
"theme_toggle.dark": "Dark",
"theme_toggle.light": "Light",
"theme_toggle.system": "System",
@ -1161,10 +1312,10 @@
"time_remaining.minutes": "{number, plural, one {# minute} other {# minutes}} left",
"time_remaining.moments": "Moments remaining",
"time_remaining.seconds": "{number, plural, one {# second} other {# seconds}} left",
"toast.view": "View",
"trends.count_by_accounts": "{count} {rawCount, plural, one {person} other {people}} talking",
"trends.title": "Trends",
"trendsPanel.viewAll": "View all",
"ui.beforeunload": "Your draft will be lost if you leave.",
"unauthorized_modal.text": "You need to be logged in to do that.",
"unauthorized_modal.title": "Sign up for {site_title}",
"upload_area.title": "Drag & drop to upload",

View File

@ -20,7 +20,7 @@
"dev": "${npm_execpath} run start",
"build": "npx webpack",
"jsdoc": "npx jsdoc -c jsdoc.conf.js",
"manage:translations": "npx ts-node ./translationRunner.ts",
"manage:translations": "npx ts-node ./scripts/translationRunner.ts",
"test": "npx cross-env NODE_ENV=test npx jest",
"test:coverage": "${npm_execpath} run test --coverage",
"test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint",
@ -246,6 +246,6 @@
"tailwindcss": "^3.2.1",
"ts-jest": "^28.0.5",
"webpack-dev-server": "^4.9.1",
"yargs": "^16.0.3"
"yargs": "^17.6.2"
}
}

View File

@ -3,6 +3,7 @@ import path from 'path';
import * as parser from 'intl-messageformat-parser';
import manageTranslations, { readMessageFiles, ExtractedDescriptor } from 'react-intl-translations-manager';
import yargs from 'yargs';
type Validator = (language: string) => void;
@ -13,7 +14,7 @@ interface LanguageResult {
const RFC5646_REGEXP = /^[a-z]{2,3}(?:-(?:x|[A-Za-z]{2,4}))*$/;
const rootDirectory = path.resolve(__dirname);
const rootDirectory = path.resolve(__dirname, '..');
const translationsDirectory = path.resolve(rootDirectory, 'app', 'soapbox', 'locales');
const messagesDirectory = path.resolve(rootDirectory, 'build', 'messages');
const availableLanguages = fs.readdirSync(translationsDirectory).reduce((languages, filename) => {
@ -68,14 +69,15 @@ Available languages:
${availableLanguages.join(', ')}
`;
const { argv } = require('yargs')
const argv = yargs
.usage(usage)
.option('f', {
alias: 'force',
default: false,
describe: 'force using the provided languages. create files if not exists.',
type: 'boolean',
});
})
.parseSync();
// check if message directory exists
if (!fs.existsSync(messagesDirectory)) {
@ -87,7 +89,7 @@ Try to run "yarn build" first`);
}
// determine the languages list
const languages: string[] = (argv._.length > 0) ? argv._ : availableLanguages;
const languages: string[] = (argv._.length > 0) ? argv._.map(String) : availableLanguages;
const validators: Validator[] = [
testRFC5646,
@ -105,7 +107,7 @@ manageTranslations({
messagesDirectory,
translationsDirectory,
detectDuplicateIds: false,
singleMessagesFile: true,
singleMessagesFile: false,
languages,
jsonOptions: {
trailingNewline: true,

View File

@ -4305,6 +4305,15 @@ cliui@^7.0.2:
strip-ansi "^6.0.0"
wrap-ansi "^7.0.0"
cliui@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.1"
wrap-ansi "^7.0.0"
clone-deep@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387"
@ -12481,7 +12490,7 @@ yaml@^1.10.0, yaml@^1.10.2:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
yargs-parser@^20.2.2, yargs-parser@^20.2.3:
yargs-parser@^20.2.3:
version "20.2.9"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
@ -12491,18 +12500,10 @@ yargs-parser@^21.0.0, yargs-parser@^21.0.1:
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35"
integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==
yargs@^16.0.3:
version "16.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.0"
y18n "^5.0.5"
yargs-parser "^20.2.2"
yargs-parser@^21.1.1:
version "21.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
yargs@^17.3.1:
version "17.5.1"
@ -12517,6 +12518,19 @@ yargs@^17.3.1:
y18n "^5.0.5"
yargs-parser "^21.0.0"
yargs@^17.6.2:
version "17.6.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541"
integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==
dependencies:
cliui "^8.0.1"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.3"
y18n "^5.0.5"
yargs-parser "^21.1.1"
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"