Re: [SailfishDevel] translations and internationalisations

2015-03-20 Thread Matthias Fehring
Hey Stefan,

the ts file without language code extension is like a template file for 
further languages. That is the reason why it is not compiled into a qm file. 
It would only contain strings that already exist in your source code. So if 
you use qsTr with English as source language there is no need to translate 
this into english again.

English translations are needed if you want to have plural forms displayed 
correctly, but then there only the plurals have to be translated.

It would be different if you use qsTrId, because then there is no real source 
string inside the code. So in that case you would also need english 
translation files. But ts files without lang code would still be templates.

lupdate is, as you aspected, used for extracting translatable strings form the 
source code.

lrelease compiles ts text files into binary qm files that are used by 
QTranslator. [0]

If you want to have your app translated you need to install a translator as 
described in [0].

Best greetings
Buschmann

[0] http://doc.qt.io/qt-5/qtranslator.html

Am Freitag, 20. März 2015, 13:18:51 schrieb s...@bredband.net:
 Hi
 
 I created a new project, myapp, wich contain the following
 translations files
 
 harbour-myapp-de.ts
 
  About
 
 
 About
 
 harbour-myapp.ts
 
  About
 
  About
 
 About.qml pages looks like this
 
 
 Page {
 ..
 ..
 
  title: qsTr(About)
  }
 
 When I compile the
 project Qt have only built the de file, in
 ../build-harbour-myApp-MerSDK_SailfishOS_i486-Debug/translations/
 
 
 harbour-lapis-de.qm
 harbour-lapis-de.ts
 
 Should it not have built
 the other one as well, that is harbour-myapp.ts ?
 
 If I change the file
 harbour-myapp.ts (which i assume is the default one) into
 
 
 harbour-myapp.ts
 
  About
 
  About
  HELLO THERE
 
 Nothing happens on the
 screen, title: qsTr(About), still writes About and not HELLO THERE
 as expected.
 
 According to Qt homepage there are some tools, lupdate
 and lrelease mention but they are not installed in the Qt
 distribution
 and entering those at the command prompt gives error
 message.
 However lupdate/lrelease seems to be used for backward
 engineering text, lupdate extracts from the source code texts
 and
 create the .ts files, which is only useful when trying to
 internationalise an finished application.
 
 Is not qsTr using it's
 argument to look up in the .ts (.qm) files what text it should use in
 runtime?
 
 /Stefan

-- 
Das Gesetz hat zum Schneckengang verdorben, was Adlerflug geworden wäre.
(Friedrich Schiller - Die Räuber)

Und der Buschfunk spielt gerade Generation Nokia von Pascow.

www.buschmann23.de
GPG-Key: 0x614C3258
GPG Fingerprint: B770 E0D0 69CF BFC1 5FE1 D78E 3A70 A936 614C 3258


signature.asc
Description: This is a digitally signed message part.
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

[SailfishDevel] applicationDisplayName and applicationName

2015-03-20 Thread stol


Hi 

CPU x86, kubuntu 10.10, latest virtual box, Qt Creator 3.1.2,
not tested on a mobile phone, only simulator  

If my
harbour-myapp.desktop file look like this 

[Desktop
Entry]
Type=Application
X-Nemo-Application-Type=silica-qt5
Icon=harbour-myapp
Exec=harbour-myapp
Name=MyApp
Name[de]=MyApp


And I do 

 QGuiApplication app(argc, argv);
 appDispName =
app.applicationDisplayName();
 appName = app.applicationName();

I would
expect that 

appDispName=myApp
appName = harbour-myapp 

but they
don't, both are harbour-myapp, is this correct ?
(in the emulator i
can see that the emulator is reading the application display name
desktop file correctly 
because when i remove the application is says
MyApp. 

Or should i use other function calls to read the entries in
the desktop file ? 

/Stefan 

 ___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Javascript Object problem

2015-03-20 Thread Luis Manuel Ramos Da Costa
I don't know if this can help, but Javascript and QML work in separate
process, and because of this any variable change on JS to be read in QML
(or vice-versa) should be readed using a onXXXChanged (XXX bein the
variable name).

I had a similar problem with reading values from a JSON object, where the
QML was returning -1 from a variable where the value number, 100 for
example, was already lodaded.

2015-03-19 12:50 GMT+00:00 Andrey Kozhevnikov coderusin...@gmail.com:

 Hello!

 Can someone help me to understand why this simple code working bad:
 https://gist.github.com/CODeRUS/3911cfe69ab9866e99da
 Just click on Add button and compare input and result id inside Object.
 It's different.

 Best regards,
 Andrey
 ___
 SailfishOS.org Devel mailing list
 To unsubscribe, please send a mail to devel-unsubscribe@lists.
 sailfishos.org

___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

[SailfishDevel] translations and internationalisations

2015-03-20 Thread stol


Hi 

I created a new project, myapp, wich contain the following
translations files 

harbour-myapp-de.ts

 About


About

harbour-myapp.ts

 About

 About

About.qml pages looks like this


Page {
..
.. 

 title: qsTr(About)
 } 

When I compile the
project Qt have only built the de file, in
../build-harbour-myApp-MerSDK_SailfishOS_i486-Debug/translations/


harbour-lapis-de.qm 
harbour-lapis-de.ts 

Should it not have built
the other one as well, that is harbour-myapp.ts ? 

If I change the file
harbour-myapp.ts (which i assume is the default one) into


harbour-myapp.ts

 About

 About
 HELLO THERE

Nothing happens on the
screen, title: qsTr(About), still writes About and not HELLO THERE
as expected. 

According to Qt homepage there are some tools, lupdate
and lrelease mention but they are not installed in the Qt
distribution
and entering those at the command prompt gives error
message.
However lupdate/lrelease seems to be used for backward
engineering text, lupdate extracts from the source code texts 
and
create the .ts files, which is only useful when trying to
internationalise an finished application. 

Is not qsTr using it's
argument to look up in the .ts (.qm) files what text it should use in
runtime? 

/Stefan 

 ___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Javascript Object problem

2015-03-20 Thread Andrey Kozhevnikov

Sorry, you understand my problem totally wrong.

20.03.2015 16:55, Luis Manuel Ramos Da Costa пишет:
I don't know if this can help, but Javascript and QML work in separate 
process, and because of this any variable change on JS to be read in 
QML (or vice-versa) should be readed using a onXXXChanged (XXX bein 
the variable name).


I had a similar problem with reading values from a JSON object, where 
the QML was returning -1 from a variable where the value number, 100 
for example, was already lodaded.


2015-03-19 12:50 GMT+00:00 Andrey Kozhevnikov coderusin...@gmail.com 
mailto:coderusin...@gmail.com:


Hello!

Can someone help me to understand why this simple code working
bad: https://gist.github.com/CODeRUS/3911cfe69ab9866e99da
Just click on Add button and compare input and result id inside
Object. It's different.

Best regards,
Andrey
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to
devel-unsubscr...@lists.sailfishos.org
mailto:devel-unsubscr...@lists.sailfishos.org




___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org