Permalink
Browse files

i18n: mark more strings for translation

  • Loading branch information...
jdavid committed Aug 3, 2017
1 parent 8f45b77 commit 7d4cbbad7dcde92d9ebd580012e11b456fc9c1ce
View
@@ -24,7 +24,7 @@
if __name__ == '__main__':
rexp = re.compile('(.*?[^a-zA-Z0-9_]|^)t\("(.*?)"[\)|,]')
rexp = re.compile('(.*?[^a-zA-Z0-9_]|^)(t|N_)\("(.*?)"[\)|,]')
pot = open('locales/messages.pot', 'w')
pot.write(HEADER)
@@ -37,7 +37,7 @@
for line_no, line in enumerate(open(filename)):
source = '%s:%d' % (filename, line_no + 1)
for match in rexp.finditer(line):
msgs.setdefault(match.group(2), []).append(source)
msgs.setdefault(match.group(3), []).append(source)
for msg in sorted(msgs):
pot.write('\n')
@@ -25,8 +25,8 @@ class AutoTitle {
const [sentence, paragraph, params] = this.locatorToSentence(command, locator);
const verb = this.commandToVerb(command);
params["@verb"] = t(verb);
params["@value"] = value;
params["verb"] = t(verb);
params["value"] = value;
return [t(sentence, params), t(paragraph, params)];
}
@@ -47,10 +47,10 @@ class AutoTitle {
linkSentenceGenerator(command, prefix, argument) {
return [
"@verb on @argument",
N_("{verb} on {argument}"),
"",
{
"@argument": argument,
"argument": argument,
},
];
}
@@ -59,10 +59,10 @@ class AutoTitle {
const elem = Translator.instance().translate(prefix+"="+argument);
const label = this.getLabel(elem);
return [
"@verb in @label",
N_("{verb} in {label}"),
"",
{
"@label": label,
"label": label,
},
];
}
@@ -24,7 +24,7 @@ import Controller from "client/walkthrough/controller";
import Bubble from "client/walkthrough/bubble";
import CommandDispatcher from "client/walkthrough/command_dispatcher";
import Translator from "client/walkthrough/translator";
import {t} from "t";
import {t, N_} from "t";
import URI from "URIjs";
import {getdata} from "util";
@@ -130,13 +130,13 @@ class Executor {
},
waiting: (tries, remainingtries) => {
const message = step.canEdit ?
"The @number. bubble is not found. Go to the !editlink form to repair it. Technical info: @locator" :
"The @number. bubble is not found. Report it to the owner.";
N_("The {number}. bubble is not found. Go to the {editlink} form to repair it. Technical info: {locator}") :
N_("The {number}. bubble is not found. Report it to the owner.");
if ((tries-remainingtries) > 10) {
this.client.showError("locator-fail", t(message, {
"@number": this.controller.state.stepIndex + 1,
"@locator": step.highlight,
"!editlink": `<a href="/walkthrough/${this.controller.state.walkthrough}" target="_top">edit walkthrough</a>`, // TODO replace this with a proper router generated link
"number": this.controller.state.stepIndex + 1,
"locator": step.highlight,
"editlink": `<a href="/walkthrough/${this.controller.state.walkthrough}" target="_top">edit walkthrough</a>`, // TODO replace this with a proper router generated link
}));
}
error = true;
@@ -107,7 +107,7 @@ class Recorder {
if (!Util.isInputElement(clickedElement)) {
const locator = LocatorGenerator.instance().generate(clickedElement);
const [title, description] = AutoTitle.instance().titleAndDescription("click", locator);
const [title, description] = AutoTitle.instance().titleAndDescription("click", locator); N_("Click");
this.client.saveStep("click", locator, null, title, description);
this.animateRecordedElement(clickedElement);
}
@@ -149,7 +149,7 @@ class Recorder {
let title, description;
switch (tagName) {
case "select":
[title, description] = AutoTitle.instance().titleAndDescription("select", locator, value);
[title, description] = AutoTitle.instance().titleAndDescription("select", locator, value); N_("Select");
this.client.saveStep("select", locator, "value=" + value, title, description);
this.animateRecordedElement(element);
break;
@@ -160,7 +160,7 @@ class Recorder {
this.client.enablePasswordParameter();
}
const value = ispw ? "[password]" : value;
[title, description] = AutoTitle.instance().titleAndDescription("type", locator, value);
[title, description] = AutoTitle.instance().titleAndDescription("type", locator, value); N_("Type");
this.client.saveStep("type", locator, value);
this.animateRecordedElement(element);
break;
@@ -169,7 +169,7 @@ class Recorder {
var valueDom = $(element.html());
valueDom.find(".walkthrough-eventabsorber-hover").removeClass("walkthrough-eventabsorber-hover");
var finalValue = $("<div />").append(valueDom).html();
[title, description] = AutoTitle.instance().titleAndDescription("type", locator, finalValue);
[title, description] = AutoTitle.instance().titleAndDescription("type", locator, finalValue); N_("Type");
this.client.saveStep("type", locator, finalValue, title, description);
this.animateRecordedElement(element);
} else {
@@ -47,6 +47,7 @@ class EmbedCodeBuilder extends React.Component {
let advancedSettings = null;
if (this.props.enableAdvanced && !this.props.showCode) {
if (this.props.showAdvanced) {
N_("none"); N_("bottom right"); N_("bottom left"); N_("top right"), N_("top left");
const positions = ["none", "bottom-right", "bottom-left", "top-right", "top-left"].map((position) => {
const label = t(position.replace("-", " "));
return (
@@ -45,12 +45,12 @@ if (WALKHUB_ANNOUNCEMENT) {
let menuItems = {
navbar: {
left: [
{path: "https://github.com/Pronovix/walkhub-service", label: "Download from GitHub"},
{path: "https://github.com/Pronovix/walkhub-service", label: N_("Download from GitHub")},
],
right: [
{path: "/search", label: "Search"},
{path: "/profile/me", label: "My Profile", loggedin: true},
{path: "/record", label: "Record", loggedin: true},
{path: "/search", label: N_("Search")},
{path: "/profile/me", label: N_("My Profile"), loggedin: true},
{path: "/record", label: N_("Record"), loggedin: true},
{path: "/connect", icon: "log-in", loggedin: false},
{path: "/api/auth/logout?token=CSRF_TOKEN", icon: "log-out", loggedin: true},
],
View
@@ -1 +1 @@
{"fr":{"plural-forms":"nplurals=2; plural=(n > 1);","messages":{"A walkthrough is playing or recording in a different window or tab. Do not close this window.":["Une visite guidée est en cours d'exectution ou d'enregistrement dans une autre fenêtre ou un autre onglet. Ne fermez pas cette fenetre ou cet onlget"],"Abort walkthrough":["Mettre fin à la visite guidée\t"],"Add new site":["Add new site"],"Advanced settings":["Réglages avancés"],"Are you sure that you want to delete this walkthrough?":["Etes vous certain de vouloir supprimer cette visite guidée?"],"Authentication":["Identification"],"Back":["Revenir"],"Cancel":["Annuler"],"Cancel walkthrough":["Annuler la visite guidée"],"Close":["Fermer"],"Code":["Code"],"Command":["Commande"],"Connect":["Connecter"],"Continue":["Poursuivez"],"Create your Walkthrough GIF":["Create your Walkthrough GIF"],"Delete":["Supprimer"],"Description":["Description"],"Disable":["Désactiver"],"Disable 2-factor authentication":["Désactiver l'identification en 2 étapes"],"E-mail":[""],"Edit":["Modifier"],"Edit walkthrough":["Modifier la visite guidée"],"Email":["e-mail"],"Embed codes":["Embed codes"],"Embed these results":["Embed these results"],"Enable 2-factor authentication":["Activer l'identification en 2 étapes"],"Failed to open the popup automatically.":["Echec de l'ouverture automatique du pop-up"],"Finish & Save":["Finish & Save"],"First argument":["Premier argument"],"Forgot your password?":["Mot de passe oublié ?"],"Generate my code!":["Generer mon code !"],"Generate my embed code!":["Generate my embed code!"],"Generate your personalized embed code to record and play walkthroughs":["Generate your personalized embed code to record and play walkthroughs"],"Get help":["Demande d'assistance"],"Help center":["Centre d'assistance"],"Highlight":["Surligner"],"Invalid url":["Invalid url"],"It looks like you haven't got a Walkthrough yet. Add an embed code first to your site.":["It looks like you haven't got a Walkthrough yet. Add an embed code first to your site."],"Loading ...":["Chargement en cours ..."],"Log in":["S'identifier"],"Log in with {label}":[""],"My Walkthroughs":["My Walkthroughs"],"Name":["Nom"],"New again:":["Renouveller"],"New to WalkHub?":["Bienvenue à Walkhub"],"New:":["Nouveau"],"Next":["Suivant"],"Off":["Inactif"],"Old:":["Vieux"],"On":["Actif"],"Open":["Ouvrir"],"Open walkthrough manually":["Ouverture manuelle de la visite guidée"],"Password":["Mot de passe"],"Password change":["Changement de mot de passe"],"Password confirm":["Confirmation du mot de passe"],"Play":["Lancer"],"Play walkthrough":["Lancer la visite guidée"],"Position":["Position"],"Record":["Enregistrer"],"Record button":["Bouton Enregistrer"],"Record walkthrough":["Enregistrer la visite guidée"],"Record walkthroughs and play them on top of websites":["Record walkthroughs and play them on top of websites"],"Recorded steps":["Etapes enregistrées"],"Recorder embed code":["Recorder embed code"],"Recovery email has been sent.":["Recovery email has been sent."],"Register":["S'inscrire"],"Request a one-time login link":["Request a one-time login link"],"Reset":["Ré-initialisation"],"Reset form":["Ré-initialiser le formulaire"],"Save":["Enregistrer"],"Screening gif":["Screening gif"],"Screening widget":["Screening widget"],"Search":["Recherche"],"Second argument":["Second argument"],"Sign in":[""],"Sign up for free":["Inscription gratuite"],"Starting URL":["URL de démarrage"],"Steps":["Etapes"],"Suggestions: ":[""],"The site might not be compatible with this walkhub":["Ce site peut ne pas être compatible avec cette visite guidée"],"The walkthrough is recorded on an HTTP website. Playing the walkthrough will temporarly reload the page in HTTP.":["La visite guidée s'effectue sur un site non sécurisé (HTTP)"],"This walkthrough is only enabled in popup mode":["Cette visite guidée s'effectue obligatoirement en mode pop-up"],"Title":["Titre"],"To enable WalkHub, you need to place this code so that it will be rendered on every page":["To enable WalkHub, you need to place this code so that it will be rendered on every page"],"Token":["Token"],"Two-factor authentication":["Identification en 2 étapes"],"Untitled walkthrough":["Visite guidée sans titre"],"Update your Walkthrough GIF":["Update your Walkthrough GIF"],"Verification email has been sent.":["Verification email has been sent"],"Verify":["Verifier"],"Walkthrough":["Visite guidée"],"Walkthrough on {domain}":["Walkthroughs on the site"],"Walkthroughs on the site":["Walkthroughs on the site"],"Welcome to WalkHub!":["Bienvenue à Walkhub"],"Your Walkthrough will be recorded in a new browser tab, just close the tab when you are finished.":["Your Walkthrough will be recorded in a new browser tab, just close the tab when you are finished."],"email":["e-mail"],"website url":["UURL du site web"],"{label} log in":[""]}}}
{"fr":{"plural-forms":"nplurals=2; plural=(n > 1);","messages":{"A walkthrough is playing or recording in a different window or tab. Do not close this window.":["Une visite guidée est en cours d'exectution ou d'enregistrement dans une autre fenêtre ou un autre onglet. Ne fermez pas cette fenetre ou cet onlget"],"Abort walkthrough":["Mettre fin à la visite guidée\t"],"Add new site":["Add new site"],"Advanced settings":["Réglages avancés"],"Are you sure that you want to delete this walkthrough?":["Etes vous certain de vouloir supprimer cette visite guidée?"],"Authentication":["Identification"],"Back":["Revenir"],"Cancel":["Annuler"],"Cancel walkthrough":["Annuler la visite guidée"],"Click":[""],"Close":["Fermer"],"Code":["Code"],"Command":["Commande"],"Connect":["Connecter"],"Continue":["Poursuivez"],"Create your Walkthrough GIF":["Create your Walkthrough GIF"],"Delete":["Supprimer"],"Description":["Description"],"Disable":["Désactiver"],"Disable 2-factor authentication":["Désactiver l'identification en 2 étapes"],"Download from GitHub":[""],"E-mail":[""],"Edit":["Modifier"],"Edit walkthrough":["Modifier la visite guidée"],"Email":["e-mail"],"Embed codes":["Embed codes"],"Embed these results":["Embed these results"],"Enable 2-factor authentication":["Activer l'identification en 2 étapes"],"Failed to open the popup automatically.":["Echec de l'ouverture automatique du pop-up"],"Finish & Save":["Finish & Save"],"First argument":["Premier argument"],"Forgot your password?":["Mot de passe oublié ?"],"Generate my code!":["Generer mon code !"],"Generate my embed code!":["Generate my embed code!"],"Generate your personalized embed code to record and play walkthroughs":["Generate your personalized embed code to record and play walkthroughs"],"Get help":["Demande d'assistance"],"Help center":["Centre d'assistance"],"Highlight":["Surligner"],"Invalid url":["Invalid url"],"It looks like you haven't got a Walkthrough yet. Add an embed code first to your site.":["It looks like you haven't got a Walkthrough yet. Add an embed code first to your site."],"Loading ...":["Chargement en cours ..."],"Log in":["S'identifier"],"Log in with {label}":[""],"My Profile":[""],"My Walkthroughs":["My Walkthroughs"],"Name":["Nom"],"New again:":["Renouveller"],"New to WalkHub?":["Bienvenue à Walkhub"],"New:":["Nouveau"],"Next":["Suivant"],"Off":["Inactif"],"Old:":["Vieux"],"On":["Actif"],"Open":["Ouvrir"],"Open walkthrough manually":["Ouverture manuelle de la visite guidée"],"Password":["Mot de passe"],"Password change":["Changement de mot de passe"],"Password confirm":["Confirmation du mot de passe"],"Play":["Lancer"],"Play walkthrough":["Lancer la visite guidée"],"Position":["Position"],"Record":["Enregistrer"],"Record button":["Bouton Enregistrer"],"Record walkthrough":["Enregistrer la visite guidée"],"Record walkthroughs and play them on top of websites":["Record walkthroughs and play them on top of websites"],"Recorded steps":["Etapes enregistrées"],"Recorder embed code":["Recorder embed code"],"Recovery email has been sent.":["Recovery email has been sent."],"Register":["S'inscrire"],"Request a one-time login link":["Request a one-time login link"],"Reset":["Ré-initialisation"],"Reset form":["Ré-initialiser le formulaire"],"Save":["Enregistrer"],"Screening gif":["Screening gif"],"Screening widget":["Screening widget"],"Search":["Recherche"],"Second argument":["Second argument"],"Select":[""],"Sign in":[""],"Sign up for free":["Inscription gratuite"],"Starting URL":["URL de démarrage"],"Steps":["Etapes"],"Suggestions: ":[""],"The site might not be compatible with this walkhub":["Ce site peut ne pas être compatible avec cette visite guidée"],"The walkthrough is recorded on an HTTP website. Playing the walkthrough will temporarly reload the page in HTTP.":["La visite guidée s'effectue sur un site non sécurisé (HTTP)"],"The {number}. bubble is not found. Go to the {editlink} form to repair it. Technical info: {locator}":[""],"The {number}. bubble is not found. Report it to the owner.":[""],"This walkthrough is only enabled in popup mode":["Cette visite guidée s'effectue obligatoirement en mode pop-up"],"Title":["Titre"],"To enable WalkHub, you need to place this code so that it will be rendered on every page":["To enable WalkHub, you need to place this code so that it will be rendered on every page"],"Token":["Token"],"Two-factor authentication":["Identification en 2 étapes"],"Type":[""],"Untitled walkthrough":["Visite guidée sans titre"],"Update your Walkthrough GIF":["Update your Walkthrough GIF"],"Verification email has been sent.":["Verification email has been sent"],"Verify":["Verifier"],"Walkthrough":["Visite guidée"],"Walkthrough on {domain}":["Walkthroughs on the site"],"Walkthroughs on the site":["Walkthroughs on the site"],"Welcome to WalkHub!":["Bienvenue à Walkhub"],"Your Walkthrough will be recorded in a new browser tab, just close the tab when you are finished.":["Your Walkthrough will be recorded in a new browser tab, just close the tab when you are finished."],"bottom left":[""],"bottom right":[""],"email":["e-mail"],"none":[""],"top left":[""],"top right":[""],"website url":["UURL du site web"],"{label} log in":[""],"{verb} in {label}":[""],"{verb} on {argument}":["Second argument"]}}}
View
@@ -21,3 +21,9 @@ Stone.addCatalogs(messages);
Stone.setBestMatchingLocale();
export var t = Stone.gettext;
// Used only to mark strings for translation
function N_(str)
{
return str;
}
Oops, something went wrong.

0 comments on commit 7d4cbba

Please sign in to comment.