# HG changeset patch # User Chris Cannam # Date 1291324433 0 # Node ID edab92f3ea0bd14cf9a3d9e18f3543465444b76b # Parent 6bcb4a4d6521651fce1c943842cebf40f1d133ca * Add translation support -- useful for proper plural handling even in English diff -r 6bcb4a4d6521 -r edab92f3ea0b confirmcommentdialog.cpp --- a/confirmcommentdialog.cpp Thu Dec 02 18:04:21 2010 +0000 +++ b/confirmcommentdialog.cpp Thu Dec 02 21:13:53 2010 +0000 @@ -87,7 +87,7 @@ if (files.size() <= 10) { text = buildFilesText(introText, files); } else { - text = "" + introTextWithCount.arg(files.size()) + ""; + text = "" + introTextWithCount + ""; } return (QMessageBox::information(parent, title, @@ -107,7 +107,7 @@ if (files.size() <= 10) { text = buildFilesText(introText, files); } else { - text = "" + introTextWithCount.arg(files.size()) + ""; + text = "" + introTextWithCount + ""; } return (QMessageBox::warning(parent, title, @@ -151,7 +151,7 @@ if (files.size() <= 10) { text = buildFilesText(introText, files); } else { - text = "" + introTextWithCount.arg(files.size()); + text = "" + introTextWithCount; } text += tr("

Please enter your comment:"); return confirmAndComment(parent, title, text, comment, longComment); diff -r 6bcb4a4d6521 -r edab92f3ea0b easyhg.pro --- a/easyhg.pro Thu Dec 02 18:04:21 2010 +0000 +++ b/easyhg.pro Thu Dec 02 21:13:53 2010 +0000 @@ -7,6 +7,8 @@ DESTDIR = . } +TRANSLATIONS = easyhg_en.ts + OBJECTS_DIR = o MOC_DIR = o diff -r 6bcb4a4d6521 -r edab92f3ea0b easyhg.qrc --- a/easyhg.qrc Thu Dec 02 18:04:21 2010 +0000 +++ b/easyhg.qrc Thu Dec 02 21:13:53 2010 +0000 @@ -22,5 +22,6 @@ images/hdd_unmount.png images/hdd_unmount-64.png images/fileopen.png + easyhg_en.qm diff -r 6bcb4a4d6521 -r edab92f3ea0b easyhg_en.qm Binary file easyhg_en.qm has changed diff -r 6bcb4a4d6521 -r edab92f3ea0b easyhg_en.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/easyhg_en.ts Thu Dec 02 21:13:53 2010 +0000 @@ -0,0 +1,1007 @@ + + + + + ChangesetItem + + + <qt>&nbsp;<b>Revision: </b>%1</qt> + + + + + Copy identifier to clipboard + + + + + Diff to parent %1 + + + + + Diff to parent + + + + + Diff to current working folder + + + + + Update to this revision + + + + + Merge from here to current + + + + + Add tag... + + + + + ConfirmCommentDialog + + + <p>Please enter your comment:</qt> + + + + + FileStatusWidget + + + Local: + + + + + Remote: + + + + + State: + + + + + You have made no changes. + + + + + Unmodified: + + + + + Modified: + + + + + Added: + + + + + Removed: + + + + + Missing: + + + + + Untracked: + + + + + You have not changed these files. + + + + + You have changed these files since you last committed them. + + + + + These files will be added to version control next time you commit. + + + + + These files will be removed from version control next time you commit.<br>They will not be deleted from the local folder. + + + + + These files are recorded in the version control, but absent from your working folder.<br>If you intended to delete them, select them and use Remove to tell the version control system about it.<br>If you deleted them by accident, select them and use Revert to restore their previous contents. + + + + + These files are in your working folder but are not under version control.<br>Select a file and use Add to place it under version control or Ignore to remove it from this list. + + + + + Files highlighted <font color=#d40000>in red</font> have appeared since your most recent commit or update. + + + + + HgRunner + + + User name: + + + + + User name for "%1": + + + + + Enter user name + + + + + Password: + + + + + Password for "%1" at "%2": + + + + + Password for user "%1": + + + + + Enter password + + + + + HgTabWidget + + + My work + + + + + History + + + + + IncomingDialog + + + No changes waiting to pull + + + + + The command output was: + + + + + There are %n change(s) ready to pull + + There is %n change ready to pull + There are %n changes ready to pull + + + + + MainWindow + + + + EasyMercurial + + + + + About EasyMercurial + + + + + <qt><h2>About EasyMercurial</h2><p>EasyMercurial is a simple user interface for the Mercurial version control system.</p><p>EasyMercurial is based on hgExplorer by Jari Korhonen, with thanks.<br>EasyMercurial development carried out by Chris Cannam for soundsoftware.ac.uk at the Centre for Digital Music, Queen Mary, University of London.<ul><li>Copyright &copy; 2010 Jari Korhonen</li><li>Copyright &copy; 2010 Chris Cannam</li><li>Copyright &copy; 2010 Queen Mary, University of London</li></ul><p> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information. + + + + + Commit files + + + + + Tag + + + + + Enter tag: + + + + + Revert files + + + + + + + + <h3>%1</h3><p>%2 + + + + + You are about to commit the following files: + + + + + You are about to commit %n file(s): + + You are about to commit %n file: + You are about to commit %n files: + + + + + You are about to <b>revert</b> the following files to their previous committed state.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed: + + + + + You are about to <b>revert</b> %n file(s).<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed. + You are about to <b>revert</b> %n files.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed. + + You are about to <b>revert</b> %n file.<br><br>This will <b>throw away any changes</b> that you have made to this file but have not committed. + You are about to <b>revert</b> %n files.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed. + + + + + Confirm pull + + + + + Confirm pull from remote repository + + + + + You are about to pull from the following remote repository: + + + + + Confirm push + + + + + Confirm push to remote repository + + + + + You are about to push to the following remote repository: + + + + + Open Repository + + + + + <qt><big>What would you like to open?</big></qt> + + + + + <qt><center><img src=":images/browser-64.png"><br>Remote repository</center></qt> + + + + + Open a remote Mercurial repository, by cloning from its URL into a local folder. + + + + + <qt><center><img src=":images/hglogo-64.png"><br>Local repository</center></qt> + + + + + Open an existing local Mercurial repository. + + + + + <qt><center><img src=":images/hdd_unmount-64.png"><br>File folder</center></qt> + + + + + Open a local folder, by creating a Mercurial repository in it. + + + + + File chosen + + + + + <qt><b>Folder required</b><br><br>You asked to open "%1".<br>This is a file; to open a repository, you need to choose a folder.</qt> + + + + + + Folder does not exist + + + + + <qt><b>Folder does not exist</b><br><br>You asked to open "%1".<br>This folder does not exist, and it cannot be created because its parent does not exist either.</qt> + + + + + + Path is in existing repository + + + + + <qt><b>Path is in an existing repository</b><br><br>You asked to initialise a repository at "%1".<br>This path is already inside an existing repository.</qt> + + + + + + Path is a file + + + + + <qt><b>Path is a file</b><br><br>You asked to initialise a repository at "%1".<br>This is an existing file; it is only possible to initialise in folders.</qt> + + + + + <qt><b>Local path is in an existing repository</b><br><br>You asked to open a remote repository by cloning it to the local path "%1".<br>This path is already inside an existing repository.<br>Please provide a new folder name for the local repository.</qt> + + + + + <qt><b>Local path is a file</b><br><br>You asked to open a remote repository by cloning it to the local path "%1".<br>This path is an existing file.<br>Please provide a new folder name for the local repository.</qt> + + + + + Folder exists + + + + + <qt><b>Local folder already exists</b><br><br>You asked to open a remote repository by cloning it to the local path "%1".<br>This is the path of an existing folder.<br>Please provide a new folder name for the local repository.</qt> + + + + + Path is inside a repository + + + + + <qt><b>Open the repository that contains this path?</b><br><br>You asked to open "%1".<br>This is not the root folder of a repository.<br>But it is inside a repository, whose root is at "%2". <br><br>Would you like to open that repository instead?</qt> + + + + + Folder has no repository + + + + + <qt><b>Initialise a repository here?</b><br><br>You asked to open "%1".<br>This folder does not contain a Mercurial repository.<br><br>Would you like to initialise a repository here?</qt> + + + + + <qt><b>Initialise a new repository?</b><br><br>You asked to open "%1".<br>This folder does not yet exist.<br><br>Would you like to create the folder and initialise a new empty repository in it?</qt> + + + + + Repository exists + + + + + <qt><b>Open existing repository?</b><br><br>You asked to initialise a new repository at "%1".<br>This folder already contains a repository. Would you like to open it?</qt> + + + + + Ok + + + + + Mercurial command did not return any output. + + + + + Pushed %n changeset(s) + + Pushed %n changeset + Pushed %n changesets + + + + + No changes to push + + + + + Push complete + + + + + The push command output was: + + + + + Pulled %n changeset(s) + + Pulled %n changeset + Pulled %n changesets + + + + + No changes to pull + + + + + Pull complete + + + + + The pull command output was: + + + + + <qt><h3>Command failed</h3><p>The following command failed:</p><code>%1</code>%2</qt> + + + + + <p>Its output said:</p><code>%1</code> + + + + + Command failed + + + + + + Update + + + + + + Merge + + + + + Merge retry + + + + + Merge retry successful. + + + + + the default branch + + + + + branch "%1" + + + + + On %1. Not at the head of the branch: consider updating + + + + + <b>Awaiting merge</b> on %1 + + + + + At the head of %1 + + + + + Init local repository + + + + + Create an empty local repository in selected folder + + + + + Clone from remote + + + + + Clone from remote repository into local repository in selected folder + + + + + Open... + + + + + Open repository + + + + + Settings... + + + + + View and change application settings + + + + + Exit + + + + + Exit application + + + + + Refresh + + + + + Refresh (info of) status of workfolder files + + + + + Preview + + + + + View info of changesets incoming to us from remote repository (on pull operation) + + + + + Pull + + + + + Pull changesets from remote repository to local repository + + + + + Push + + + + + Push local changesets to remote repository + + + + + + Diff + + + + + Filediff: View differences between selected working folder file and local repository file + + + + + Folderdiff: View all differences between working folder files and local repository files + + + + + View changesetdiff + + + + + Change set diff: View differences between all files of 2 repository changesets + + + + + Revert + + + + + Undo selected working folder file changes (return to local repository version) + + + + + Add + + + + + Add working folder file(s) (selected or all yet untracked) to local repository (on next commit) + + + + + Remove + + + + + Remove selected working folder file from local repository (on next commit) + + + + + Update working folder from local repository + + + + + Commit + + + + + Save selected file(s) or all changed files in working folder (and all subfolders) to local repository + + + + + Merge two local repository changesets to working folder + + + + + Annotate + + + + + Show line-by-line version information for selected file + + + + + Resolve (list) + + + + + Resolve (list): Show list of files needing merge + + + + + Resolve (mark) + + + + + Resolve (mark): Mark selected file status as resolved + + + + + Retry merge + + + + + Retry merge after failed merge attempt. + + + + + Tag revision + + + + + Give decsriptive name (tag) to current workfolder parent revision. + + + + + Edit .hgignore + + + + + Edit .hgignore file (file contains names of files that should be ignored by mercurial) + + + + + Serve (via http) + + + + + Serve local repository via http for workgroup access + + + + + About + + + + + Show the application's About box + + + + + About Qt + + + + + Show the Qt library's About box + + + + + Clear selections + + + + + + File + + + + + Advanced + + + + + Help + + + + + Ready + + + + + MultiChoiceDialog + + + &URL: + + + + + + &File: + + + + + Browse... + + + + + Open Directory + + + + + Open File + + + + + + &Folder: + + + + + QApplication + + + EasyMercurial + + + + + QObject + + + Identifier + + + + + Author + + + + + Date + + + + + Branch + + + + + Tag + + + + + Comment + + + + + RepositoryDialog + + + Open Repository + + + + + StartupDialog + + + About me + + + + + <qt><big>Welcome to EasyMercurial!</qt></big><br>How would you like to be identified in commit messages? + + + + + Name: + + + + + Email address: + + + + + <br>You will appear as: + + + + + UncommittedItem + + + <qt>&nbsp;<b>Uncommitted changes</b></qt> + + + + + Diff + + + + + Commit... + + + + + Revert... + + + + + Uncommitted changes + + + + + Uncommitted + + + + + changes + + + + diff -r 6bcb4a4d6521 -r edab92f3ea0b main.cpp --- a/main.cpp Thu Dec 02 18:04:21 2010 +0000 +++ b/main.cpp Thu Dec 02 21:13:53 2010 +0000 @@ -20,6 +20,7 @@ #include "debug.h" #include +#include #include int main(int argc, char *argv[]) @@ -35,6 +36,13 @@ installSignalHandlers(); QApplication app(argc, argv); + + QTranslator translator; + QString language = QLocale::system().name(); + QString trname = QString("easyhg_%1").arg(language); + translator.load(trname, ":"); + app.installTranslator(&translator); + QStringList args = app.arguments(); MainWindow mainWin; mainWin.show(); diff -r 6bcb4a4d6521 -r edab92f3ea0b mainwindow.cpp --- a/mainwindow.cpp Thu Dec 02 18:04:21 2010 +0000 +++ b/mainwindow.cpp Thu Dec 02 21:13:53 2010 +0000 @@ -318,11 +318,15 @@ QStringList reportFiles = files; if (reportFiles.empty()) reportFiles = hgTabs->getAllCommittableFiles(); + QString cf(tr("Commit files")); + if (ConfirmCommentDialog::confirmAndGetLongComment (this, - tr("Commit files"), - tr("

Commit files

You are about to commit the following files:"), - tr("

Commit files

You are about to commit %1 files."), + cf, + tr("

%1

%2").arg(cf) + .arg(tr("You are about to commit the following files:")), + tr("

%1

%2").arg(cf) + .arg(tr("You are about to commit %n file(s):", "", reportFiles.size())), reportFiles, comment)) { @@ -518,12 +522,16 @@ QStringList files = hgTabs->getSelectedRevertableFiles(); if (files.empty()) files = hgTabs->getAllRevertableFiles(); + + QString rf(tr("Revert files")); if (ConfirmCommentDialog::confirmDangerousFilesAction (this, - tr("Revert files"), - tr("

Revert files

You are about to revert the following files to their previous committed state.

This will throw away any changes that you have made to these files but have not committed:"), - tr("

Revert files

You are about to revert %1 files.

This will throw away any changes that you have made to these files but have not committed."), + rf, + tr("

%1

%2").arg(rf) + .arg(tr("You are about to revert the following files to their previous committed state.

This will throw away any changes that you have made to these files but have not committed:")), + tr("

%1

%2").arg(rf) + .arg(tr("You are about to revert %n file(s).

This will throw away any changes that you have made to these files but have not committed.", "", files.size())), files)) { if (files.empty()) {