Skip to content

Commit 61022aa

Browse files
committed
Merge pull request #348 from hzulla/master
i18n - turn off translations for this release
2 parents c71abce + e83abc7 commit 61022aa

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

TRANSLATION.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Translations for the tutorial are located in
88
Translations for the Qt GUI are located in
99
[`app/gui/qt/lang/sonic-pi_<LANG>.ts`](./app/gui/qt/lang/).
1010

11+
## Please note
12+
13+
The i18n code is disabled right now. If you want to enable it to test
14+
your translation, set the required constants in `main.cpp`
15+
(`ENABLE_I18N`) and `qt-doc.rb` (`enable_i18n`).
16+
1117
## Translating the tutorial
1218

1319
- Sign up with [github](https://help.github.com/categories/bootcamp/)

app/gui/qt/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// notice is included.
1212
//++
1313

14+
// i18n not enabled until translations are ready
15+
// #define ENABLE_I18N
16+
1417
#include <QApplication>
1518
#include <QSplashScreen>
1619
#include <QPixmap>
@@ -28,6 +31,7 @@ int main(int argc, char *argv[])
2831

2932
QApplication app(argc, argv);
3033

34+
#ifdef ENABLE_I18N
3135
QString systemLocale = QLocale::system().name();
3236

3337
QTranslator qtTranslator;
@@ -40,6 +44,7 @@ int main(int argc, char *argv[])
4044
std::cout << "Please contact us if you want to translate Sonic Pi to your language." << std::endl;
4145
}
4246
app.installTranslator(&translator);
47+
#endif
4348

4449
app.setApplicationName(QObject::tr("Sonic Pi"));
4550
app.setStyle("gtk");

app/server/bin/qt-doc.rb

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
require 'kramdown'
2626
require 'active_support/inflector'
2727

28+
# i18n not enabled until translations are ready
29+
enable_i18n = false
2830

2931
class MarkdownConverter
3032
def self.convert(contents)
@@ -176,16 +178,20 @@ def self.massage!(html)
176178
# "loop" => "Loop forever",
177179
}
178180

179-
# this will sort locale code names by reverse length
180-
# to make sure that a more specific locale is handled
181-
# before the generic language code,
182-
# e.g., "de_CH" should be handled before "de"
183-
languages = Dir.
184-
glob("#{tutorial_path}/*").
185-
select {|f| File.directory? f}.
186-
map {|f| File.basename f}.
187-
select {|n| n != "en"}.
188-
sort_by {|n| -n.length}
181+
if enable_i18n then
182+
# this will sort locale code names by reverse length
183+
# to make sure that a more specific locale is handled
184+
# before the generic language code,
185+
# e.g., "de_CH" should be handled before "de"
186+
languages = Dir.
187+
glob("#{tutorial_path}/*").
188+
select {|f| File.directory? f}.
189+
map {|f| File.basename f}.
190+
select {|n| n != "en"}.
191+
sort_by {|n| -n.length}
192+
else
193+
languages = []
194+
end
189195

190196
docs << "\n QString systemLocale = QLocale::system().name();\n\n" unless languages.empty?
191197

0 commit comments

Comments
 (0)