Merge pull request #5338 from vector-im/dbkr/i18n_script

Switch to gen-i18n script
This commit is contained in:
Luke Barnard 2017-10-19 11:25:40 +01:00 committed by GitHub
commit ae9263fa59
3 changed files with 220 additions and 218 deletions

View file

@ -28,9 +28,10 @@ function getColorName(hex) {
## Adding new strings
1. Check if the import ``import { _t } from 'matrix-react-sdk/lib/languageHandler';`` is present. If not add it to the other import statements. Also import `_td` if needed.
2. Add ``_t()`` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method). If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
3. Add the String to the ``en_EN.json`` file in ``src/i18n/strings`` (respect which repository you are on).
1. Check if the import ``import { _t } from 'matrix-react-sdk/lib/languageHandler';`` is present. If not add it to the other import statements. Also import `_td` if needed.
1. Add ``_t()`` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method). If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
1. Run `npm run i18n` to update ``src/i18n/strings/en_EN.json`` (if it fails because it can't find the script, your dev environment predates the script, so reinstall/link react-sdk with `npm link ../matrix-react-sdk`). If it segfaults, you may be on Node 6, so try a newer version of node.
1. If you added a string with a plural, you can add other English plural variants to ``src/i18n/strings/en_EN.json`` (remeber to edit the one in the same project as the source file containing your new translation).
## Adding variables inside a string.

View file

@ -28,6 +28,7 @@
"scripts": {
"reskindex": "reskindex -h src/header",
"reskindex:watch": "reskindex -h src/header -w",
"i18n": "matrix-gen-i18n",
"build:res": "node scripts/copy-res.js",
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
"build:compile": "npm run reskindex && babel --source-maps -d lib src",

View file

@ -1,152 +1,55 @@
{
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s",
"<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.": "<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.",
"A new version of Riot is available.": "A new version of Riot is available.",
"Add an email address above to configure email notifications": "Add an email address above to configure email notifications",
"Advanced notification settings": "Advanced notification settings",
"All messages": "All messages",
"All messages (loud)": "All messages (loud)",
"All Rooms": "All Rooms",
"All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.",
"An error occurred whilst saving your email notification preferences.": "An error occurred whilst saving your email notification preferences.",
"Back": "Back",
"Bug report sent": "Bug report sent",
"Call invitation": "Call invitation",
"Cancel": "Cancel",
"Cancel Sending": "Cancel Sending",
"Can't update user notification settings": "Can't update user notification settings",
"Changelog": "Changelog",
"Close": "Close",
"Collapse panel": "Collapse panel",
"Riot is not supported on mobile web. Install the app?": "Riot is not supported on mobile web. Install the app?",
"Collecting app version information": "Collecting app version information",
"Collecting logs": "Collecting logs",
"Couldn't find a matching Matrix room": "Couldn't find a matching Matrix room",
"Custom Server Options": "Custom Server Options",
"customServer_text": "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.<br/>This allows you to use Riot with an existing Matrix account on a different home server.<br/><br/>You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.",
"delete the alias.": "delete the alias.",
"Delete the room alias %(alias)s and remove %(name)s from the directory?": "Delete the room alias %(alias)s and remove %(name)s from the directory?",
"Describe your problem here.": "Describe your problem here.",
"Developer Tools": "Developer Tools",
"Direct Chat": "Direct Chat",
"Directory": "Directory",
"Dismiss": "Dismiss",
"Download this file": "Download this file",
"Enable audible notifications in web client": "Enable audible notifications in web client",
"Enable desktop notifications": "Enable desktop notifications",
"Show message in desktop notification": "Show message in desktop notification",
"Enable email notifications": "Enable email notifications",
"Enable notifications for this account": "Enable notifications for this account",
"Enable them now": "Enable them now",
"Enter keywords separated by a comma:": "Enter keywords separated by a comma:",
"Error": "Error",
"Error saving email notification preferences": "Error saving email notification preferences",
"#example": "#example",
"Expand panel": "Expand panel",
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
"Failed to change settings": "Failed to change settings",
"Failed to forget room %(errCode)s": "Failed to forget room %(errCode)s",
"Failed to update keywords": "Failed to update keywords",
"Failed to get protocol list from Home Server": "Failed to get protocol list from Home Server",
"Failed to get public room list": "Failed to get public room list",
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
"Failed to send custom event.": "Failed to send custom event.",
"Failed to send report: ": "Failed to send report: ",
"Failed to set direct chat tag": "Failed to set direct chat tag",
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
"Favourite": "Favourite",
"Fetching third party location failed": "Fetching third party location failed",
"Files": "Files",
"Filter results": "Filter results",
"Filter room names": "Filter room names",
"Forget": "Forget",
"Forward Message": "Forward Message",
"Guests can join": "Guests can join",
"Hide panel": "Hide panel",
"(HTTP status %(httpStatus)s)": "(HTTP status %(httpStatus)s)",
"I understand the risks and wish to continue": "I understand the risks and wish to continue",
"In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:": "In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:",
"Invite to this room": "Invite to this room",
"Keywords": "Keywords",
"Leave": "Leave",
"Login": "Login",
"Loading bug report module": "Loading bug report module",
"Low Priority": "Low Priority",
"Members": "Members",
"Mentions only": "Mentions only",
"Uploading report": "Uploading report",
"Waiting for response from server": "Waiting for response from server",
"Riot Desktop on %(platformName)s": "Riot Desktop on %(platformName)s",
"Unknown device": "Unknown device",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s",
"You need to be using HTTPS to place a screen-sharing call.": "You need to be using HTTPS to place a screen-sharing call.",
"Messages containing my display name": "Messages containing my display name",
"Messages containing <span>keywords</span>": "Messages containing <span>keywords</span>",
"Messages containing my user name": "Messages containing my user name",
"Messages in group chats": "Messages in group chats",
"Messages in one-to-one chats": "Messages in one-to-one chats",
"Messages in group chats": "Messages in group chats",
"When I'm invited to a room": "When I'm invited to a room",
"Call invitation": "Call invitation",
"Messages sent by bot": "Messages sent by bot",
"more": "more",
"Mute": "Mute",
"No rooms to show": "No rooms to show",
"Noisy": "Noisy",
"Notification targets": "Notification targets",
"Notifications": "Notifications",
"Notifications on the following keywords follow rules which cant be displayed here:": "Notifications on the following keywords follow rules which cant be displayed here:",
"Error saving email notification preferences": "Error saving email notification preferences",
"An error occurred whilst saving your email notification preferences.": "An error occurred whilst saving your email notification preferences.",
"Keywords": "Keywords",
"Enter keywords separated by a comma:": "Enter keywords separated by a comma:",
"OK": "OK",
"Failed to change settings": "Failed to change settings",
"Operation failed": "Operation failed",
"Can't update user notification settings": "Can't update user notification settings",
"Failed to update keywords": "Failed to update keywords",
"Messages containing <span>keywords</span>": "Messages containing <span>keywords</span>",
"Notify for all other messages/rooms": "Notify for all other messages/rooms",
"Notify me for anything else": "Notify me for anything else",
"Enable notifications for this account": "Enable notifications for this account",
"All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.",
"Add an email address above to configure email notifications": "Add an email address above to configure email notifications",
"Enable email notifications": "Enable email notifications",
"Notifications on the following keywords follow rules which cant be displayed here:": "Notifications on the following keywords follow rules which cant be displayed here:",
"Unable to fetch notification target list": "Unable to fetch notification target list",
"Notification targets": "Notification targets",
"Advanced notification settings": "Advanced notification settings",
"There are advanced notifications which are not shown here": "There are advanced notifications which are not shown here",
"You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply",
"Enable desktop notifications": "Enable desktop notifications",
"Show message in desktop notification": "Show message in desktop notification",
"Enable audible notifications in web client": "Enable audible notifications in web client",
"Off": "Off",
"On": "On",
"Operation failed": "Operation failed",
"Permalink": "Permalink",
"Please describe the bug. What did you do? What did you expect to happen? What actually happened?": "Please describe the bug. What did you do? What did you expect to happen? What actually happened?",
"Please describe the bug and/or send logs.": "Please describe the bug and/or send logs.",
"Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.": "Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.",
"powered by Matrix": "powered by Matrix",
"Quote": "Quote",
"Reject": "Reject",
"Remove %(name)s from the directory?": "Remove %(name)s from the directory?",
"Remove": "Remove",
"remove %(name)s from the directory.": "remove %(name)s from the directory.",
"Remove from Directory": "Remove from Directory",
"Report a bug": "Report a bug",
"Resend": "Resend",
"Riot Desktop on %(platformName)s": "Riot Desktop on %(platformName)s",
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
"Riot is not supported on mobile web. Install the app?": "Riot is not supported on mobile web. Install the app?",
"Riot uses many advanced browser features, some of which are not available or experimental in your current browser.": "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.",
"Room not found": "Room not found",
"Search": "Search",
"Noisy": "Noisy",
"Failed to set direct chat tag": "Failed to set direct chat tag",
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
"Search…": "Search…",
"Search for a room": "Search for a room",
"Send": "Send",
"Send logs": "Send logs",
"Send Custom Event": "Send Custom Event",
"Send Custom State Event": "Send Custom State Event",
"Explore Room State": "Explore Room State",
"Source URL": "Source URL",
"Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.",
"The Home Server may be too old to support third party networks": "The Home Server may be too old to support third party networks",
"There are advanced notifications which are not shown here": "There are advanced notifications which are not shown here",
"The server may be unavailable or overloaded": "The server may be unavailable or overloaded",
"Search": "Search",
"This Room": "This Room",
"Unable to fetch notification target list": "Unable to fetch notification target list",
"Unable to join network": "Unable to join network",
"Unable to look up room ID from server": "Unable to look up room ID from server",
"Unavailable": "Unavailable",
"Unhide Preview": "Unhide Preview",
"Unknown device": "Unknown device",
"unknown error code": "unknown error code",
"Unnamed room": "Unnamed room",
"Update": "Update",
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
"Uploading report": "Uploading report",
"View Decrypted Source": "View Decrypted Source",
"View Source": "View Source",
"What's New": "What's New",
"What's new?": "What's new?",
"Waiting for response from server": "Waiting for response from server",
"When I'm invited to a room": "When I'm invited to a room",
"World readable": "World readable",
"You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)",
"You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)",
"You are not receiving desktop notifications": "You are not receiving desktop notifications",
"You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply",
"You must specify an event type!": "You must specify an event type!",
"Thank you!": "Thank you!",
"All Rooms": "All Rooms",
"Sunday": "Sunday",
"Monday": "Monday",
"Tuesday": "Tuesday",
@ -156,21 +59,137 @@
"Saturday": "Saturday",
"Today": "Today",
"Yesterday": "Yesterday",
"OK": "OK",
"Warning": "Warning",
"Checking for an update...": "Checking for an update...",
"Custom Server Options": "Custom Server Options",
"customServer_text": "customServer_text",
"Dismiss": "Dismiss",
"powered by Matrix": "powered by Matrix",
"You are not receiving desktop notifications": "You are not receiving desktop notifications",
"Enable them now": "Enable them now",
"What's New": "What's New",
"Update": "Update",
"What's new?": "What's new?",
"A new version of Riot is available.": "A new version of Riot is available.",
"To return to your account in future you need to <u>set a password</u>": "To return to your account in future you need to <u>set a password</u>",
"Set Password": "Set Password",
"Error encountered (%(errorDetail)s).": "Error encountered (%(errorDetail)s).",
"Checking for an update...": "Checking for an update...",
"No update available.": "No update available.",
"Downloading update...": "Downloading update...",
"Warning": "Warning",
"Error": "Error",
"You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)",
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
"Remove": "Remove",
"Close": "Close",
"Download this file": "Download this file",
"Please describe the bug and/or send logs.": "Please describe the bug and/or send logs.",
"Loading bug report module": "Loading bug report module",
"Bug report sent": "Bug report sent",
"Thank you!": "Thank you!",
"Failed to send report: ": "Failed to send report: ",
"Cancel": "Cancel",
"Report a bug": "Report a bug",
"Please describe the bug. What did you do? What did you expect to happen? What actually happened?": "Please describe the bug. What did you do? What did you expect to happen? What actually happened?",
"Describe your problem here.": "Describe your problem here.",
"In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:": "In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:",
"Send logs": "Send logs",
"Send": "Send",
"Unavailable": "Unavailable",
"Changelog": "Changelog",
"Back": "Back",
"You must specify an event type!": "You must specify an event type!",
"Event sent!": "Event sent!",
"Failed to send custom event.": "Failed to send custom event.",
"Event Type": "Event Type",
"Event Content": "Event Content",
"State Key": "State Key",
"No update available.": "No update available.",
"Downloading update...": "Downloading update...",
"You need to be using HTTPS to place a screen-sharing call.": "You need to be using HTTPS to place a screen-sharing call.",
"Edit": "Edit",
"Filter results": "Filter results",
"Send Custom Event": "Send Custom Event",
"Send Custom State Event": "Send Custom State Event",
"Explore Room State": "Explore Room State",
"Developer Tools": "Developer Tools",
"You have successfully set a password!": "You have successfully set a password!",
"You have successfully set a password and an email address!": "You have successfully set a password and an email address!",
"You can now return to your account after signing out, and sign in on other devices.": "You can now return to your account after signing out, and sign in on other devices.",
"Remember, you can always set an email address in user settings if you change your mind.": "Remember, you can always set an email address in user settings if you change your mind.",
"Continue": "Continue",
"Failed to change password. Is your password correct?": "Failed to change password. Is your password correct?",
"(HTTP status %(httpStatus)s)": "(HTTP status %(httpStatus)s)",
"Please set a password!": "Please set a password!",
"This will allow you to return to your account after signing out, and sign in on other devices.": "This will allow you to return to your account after signing out, and sign in on other devices.",
"You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)",
"Resend": "Resend",
"Cancel Sending": "Cancel Sending",
"Forward Message": "Forward Message",
"Unpin Message": "Unpin Message",
"Pin Message": "Pin Message",
"View Source": "View Source",
"View Decrypted Source": "View Decrypted Source",
"Unhide Preview": "Unhide Preview",
"Permalink": "Permalink",
"Quote": "Quote",
"Source URL": "Source URL",
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
"unknown error code": "unknown error code",
"Failed to forget room %(errCode)s": "Failed to forget room %(errCode)s",
"All messages (loud)": "All messages (loud)",
"All messages": "All messages",
"Mentions only": "Mentions only",
"Mute": "Mute",
"Leave": "Leave",
"Forget": "Forget",
"Reject": "Reject",
"Favourite": "Favourite",
"Low Priority": "Low Priority",
"Direct Chat": "Direct Chat",
"Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.",
"Riot uses many advanced browser features, some of which are not available or experimental in your current browser.": "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.",
"Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.": "Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.",
"<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.": "<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.",
"With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!": "With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!",
"I understand the risks and wish to continue": "I understand the risks and wish to continue",
"Couldn't load home page": "Couldn't load home page",
"Login": "Login",
"Register": "Register",
"Invite to this room": "Invite to this room",
"Members": "Members",
"Files": "Files",
"Notifications": "Notifications",
"Rooms": "Rooms",
"Hide panel": "Hide panel",
"Invite to this group": "Invite to this group",
"Add rooms to this group": "Add rooms to this group",
"Failed to get protocol list from Home Server": "Failed to get protocol list from Home Server",
"The Home Server may be too old to support third party networks": "The Home Server may be too old to support third party networks",
"Failed to get public room list": "Failed to get public room list",
"The server may be unavailable or overloaded": "The server may be unavailable or overloaded",
"Unnamed room": "Unnamed room",
"Delete the room alias %(alias)s and remove %(name)s from the directory?": "Delete the room alias %(alias)s and remove %(name)s from the directory?",
"Remove %(name)s from the directory?": "Remove %(name)s from the directory?",
"Remove from Directory": "Remove from Directory",
"remove %(name)s from the directory.": "remove %(name)s from the directory.",
"delete the alias.": "delete the alias.",
"Unable to join network": "Unable to join network",
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
"Room not found": "Room not found",
"Couldn't find a matching Matrix room": "Couldn't find a matching Matrix room",
"Fetching third party location failed": "Fetching third party location failed",
"Unable to look up room ID from server": "Unable to look up room ID from server",
"World readable": "World readable",
"Guests can join": "Guests can join",
"Directory": "Directory",
"No rooms to show": "No rooms to show",
"Search for a room": "Search for a room",
"#example": "#example",
"more": "more",
"Expand panel": "Expand panel",
"Collapse panel": "Collapse panel",
"Filter room names": "Filter room names",
"Welcome to Riot.im": "Welcome to Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Decentralised, encrypted chat &amp; collaboration powered by [matrix]",
"Search the room directory": "Search the room directory",
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!",
"Chat with Riot Bot": "Chat with Riot Bot",
"Get started with some tips from Riot Bot!": "Get started with some tips from Riot Bot!",
"General discussion about Matrix and Riot": "General discussion about Matrix and Riot",
@ -194,24 +213,5 @@
"Contributing code to Matrix and Riot": "Contributing code to Matrix and Riot",
"Dev chat for the Riot/Web dev team": "Dev chat for the Riot/Web dev team",
"Dev chat for the Dendrite dev team": "Dev chat for the Dendrite dev team",
"Co-ordination for Riot/Web translators": "Co-ordination for Riot/Web translators",
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!",
"Failed to change password. Is your password correct?": "Failed to change password. Is your password correct?",
"You have successfully set a password!": "You have successfully set a password!",
"You can now return to your account after signing out, and sign in on other devices.": "You can now return to your account after signing out, and sign in on other devices.",
"Continue": "Continue",
"Pin Message": "Pin Message",
"Unpin Message": "Unpin Message",
"Jump to message": "Jump to message",
"No pinned messages.": "No pinned messages.",
"Loading...": "Loading...",
"Please set a password!": "Please set a password!",
"This will allow you to return to your account after signing out, and sign in on other devices.": "This will allow you to return to your account after signing out, and sign in on other devices.",
"You have successfully set a password and an email address!": "You have successfully set a password and an email address!",
"Remember, you can always set an email address in user settings if you change your mind.": "Remember, you can always set an email address in user settings if you change your mind.",
"To return to your account in future you need to <u>set a password</u>": "To return to your account in future you need to <u>set a password</u>",
"Set Password": "Set Password",
"Couldn't load home page": "Couldn't load home page",
"Invite to this group": "Invite to this group",
"Add rooms to this group": "Add rooms to this group"
"Co-ordination for Riot/Web translators": "Co-ordination for Riot/Web translators"
}