Skip to contentSkip to conversation

PowerTOP: _("Cannot load from file")

Powertop Chris Ferron 2 participants 5 messages May 31, 2012 – Jun 6, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Chris Ferron

author
#1 lore raw
Quoted 11 lines · Németh Márton

Hi Chris,

I have seen in commit 0e9374d27bfa51b885ee3fe69fbb3b12bdae3600 that the last space of the "Cannot load from file " was removed. This results even in English the following output:

Cannot load from file/var/cache/powertop/saved_parameters.powertop

One solution would be something like this:

   cout<<  _("Cannot load from file")<<  " "<<  pathname<<  "\n";

Good input thank you. I am still learning about the difficulty's in translation on internationalization.
I will make some adjustments from your input.
Thanks
-Chris

Quoted 15 lines

However, in Hungarian this sentence is difficult to translate because of the word order. For example the natural translation of the following English sentence would be:

English: Cannot load from file foo.bar
Hungarian: Nem lehetett a foo.bar fájlból betölteni

As you can see in this case it would be better to use the %s format string for printing pathname because this gives better flexibility for the translator to place the pathname string in natural place in a translated sentence.

Regards,

Márton Németh

#2 lore raw

Hi Chris,

Quoted 7 lines · Chris Ferron
Quoted 6 lines · Németh Márton

Hi Chris,

I have seen in commit 0e9374d27bfa51b885ee3fe69fbb3b12bdae3600 that the last space of the "Cannot load from file " was removed. This results even in English the following output:

Quoted 8 lines
Quoted 5 lines

Cannot load from file/var/cache/powertop/saved_parameters.powertop

One solution would be something like this:

   cout<<  _("Cannot load from file")<<  " "<<  pathname<<  "\n";

Good input thank you. I am still learning about the difficulty's in translation on internationalization.
I will make some adjustments from your input.

See the attached patch what I really ment.

Otherwise it could be also better as I described:

Quoted 7 lines
Quoted 7 lines

However, in Hungarian this sentence is difficult to translate because of the word order. For example the natural translation of the following English sentence would be:

English: Cannot load from file foo.bar
Hungarian: Nem lehetett a foo.bar fájlból betölteni

Quoted 7 lines
Quoted 7 lines

As you can see in this case it would be better to use the %s format string for printing pathname because this gives better flexibility for the translator to place the pathname string in natural place in a translated sentence.

Regards,

Márton Németh

From: Márton Németh <nm127(a)freemail.hu>

Fix space between localized string and pathname.

Signed-off-by Márton Németh <nm127(a)freemail.hu>

---

src/parameters/persistent.cpp +4 -4
index 47b8824..553cccb 100644
@@ -43,7 +43,7 @@ void save_all_results(const char *filename)
 
 	file.open(pathname, ios::out);
 	if (!file) {
-		cout << _("Cannot save to file ") << pathname << "\n";
+		cout << _("Cannot save to file") << " " << pathname << "\n";
 		return;
 	}
 	for (i = 0; i < past_results.size(); i++) {
@@ -75,7 +75,7 @@ void load_results(const char *filename)
 
 	file.open(pathname, ios::in);
 	if (!file) {
-		cout << _("Cannot load from file ") << pathname << "\n";
+		cout << _("Cannot load from file") << " " << pathname << "\n";
 		return;
 	}
 
@@ -137,7 +137,7 @@ void save_parameters(const char *filename)
 
 	file.open(pathname, ios::out);
 	if (!file) {
-		cout << _("Cannot save to file ")<< " "<< pathname << "\n";
+		cout << _("Cannot save to file") << " " << pathname << "\n";
 		return;
 	}
 
@@ -162,7 +162,7 @@ void load_parameters(const char *filename)
 
 	file.open(pathname, ios::in);
 	if (!file) {
-		cout << _("Cannot load from file ")<< " "<< pathname << "\n";
+		cout << _("Cannot load from file") << " " << pathname << "\n";
 		return;
 	}
 
author
#3 lore raw
Quoted 13 lines · Németh Márton

Hi Chris,

Quoted 11 lines · Chris Ferron
Quoted 10 lines · Németh Márton

Hi Chris,

I have seen in commit 0e9374d27bfa51b885ee3fe69fbb3b12bdae3600 that the last space of the "Cannot load from file " was removed. This results even in English the following output:

Cannot load from file/var/cache/powertop/saved_parameters.powertop

One solution would be something like this:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
    cout<<   _("Cannot load from file")<<   ""<<   pathname<<   "\n";

Good input thank you. I am still learning about the difficulty's in translation on internationalization.
I will make some adjustments from your input.

See the attached patch what I really ment.

Otherwise it could be also better as I described:

ah ok.
So you would rather see translatable strings that look like this?

"PCI Device %s has no runtime power management"

or in this case

"Cannot load from file %s"
?

-Chris

Quoted 60 lines
Quoted 7 lines
Quoted 7 lines

However, in Hungarian this sentence is difficult to translate because of the word order. For example the natural translation of the following English sentence would be:

English: Cannot load from file foo.bar
Hungarian: Nem lehetett a foo.bar fájlból betölteni

Quoted 7 lines
Quoted 7 lines

As you can see in this case it would be better to use the %s format string for printing pathname because this gives better flexibility for the translator to place the pathname string in natural place in a translated sentence.

Regards,

Márton Németh

From: Márton Németh<nm127(a)freemail.hu>

Fix space between localized string and pathname.

Signed-off-by Márton Németh<nm127(a)freemail.hu>

---

src/parameters/persistent.cpp +4 -4
index 47b8824..553cccb 100644
@@ -43,7 +43,7 @@ void save_all_results(const char *filename)
 
  	file.open(pathname, ios::out);
  	if (!file) {
-		cout<<  _("Cannot save to file ")<<  pathname<<  "\n";
+		cout<<  _("Cannot save to file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
  	for (i = 0; i<  past_results.size(); i++) {
@@ -75,7 +75,7 @@ void load_results(const char *filename)
 
  	file.open(pathname, ios::in);
  	if (!file) {
-		cout<<  _("Cannot load from file ")<<  pathname<<  "\n";
+		cout<<  _("Cannot load from file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
 
@@ -137,7 +137,7 @@ void save_parameters(const char *filename)
 
  	file.open(pathname, ios::out);
  	if (!file) {
-		cout<<  _("Cannot save to file ")<<  ""<<  pathname<<  "\n";
+		cout<<  _("Cannot save to file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
 
@@ -162,7 +162,7 @@ void load_parameters(const char *filename)
 
  	file.open(pathname, ios::in);
  	if (!file) {
-		cout<<  _("Cannot load from file ")<<  ""<<  pathname<<  "\n";
+		cout<<  _("Cannot load from file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
 
#4 lore raw
Quoted 24 lines · Chris Ferron
Quoted 13 lines · Németh Márton

Hi Chris,

Quoted 11 lines · Chris Ferron
Quoted 10 lines · Németh Márton

Hi Chris,

I have seen in commit 0e9374d27bfa51b885ee3fe69fbb3b12bdae3600 that the last space of the "Cannot load from file " was removed. This results even in English the following output:

Cannot load from file/var/cache/powertop/saved_parameters.powertop

One solution would be something like this:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
    cout<<   _("Cannot load from file")<<   ""<<   pathname<<   "\n";

Good input thank you. I am still learning about the difficulty's in translation on internationalization.
I will make some adjustments from your input.

See the attached patch what I really ment.

Otherwise it could be also better as I described:

ah ok.
So you would rather see translatable strings that look like this?

Quoted 6 lines

"PCI Device %s has no runtime power management"

or in this case

"Cannot load from file %s"
?

Yes, I think it is better translatable.

Quoted 63 lines
Quoted 60 lines
Quoted 7 lines
Quoted 7 lines

However, in Hungarian this sentence is difficult to translate because of the word order. For example the natural translation of the following English sentence would be:

English: Cannot load from file foo.bar
Hungarian: Nem lehetett a foo.bar fájlból betölteni

Quoted 7 lines
Quoted 7 lines

As you can see in this case it would be better to use the %s format string for printing pathname because this gives better flexibility for the translator to place the pathname string in natural place in a translated sentence.

Regards,

Márton Németh

From: Márton Németh<nm127(a)freemail.hu>

Fix space between localized string and pathname.

Signed-off-by Márton Németh<nm127(a)freemail.hu>

---

src/parameters/persistent.cpp +4 -4
index 47b8824..553cccb 100644
@@ -43,7 +43,7 @@ void save_all_results(const char *filename)
 
  	file.open(pathname, ios::out);
  	if (!file) {
-		cout<<  _("Cannot save to file ")<<  pathname<<  "\n";
+		cout<<  _("Cannot save to file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
  	for (i = 0; i<  past_results.size(); i++) {
@@ -75,7 +75,7 @@ void load_results(const char *filename)
 
  	file.open(pathname, ios::in);
  	if (!file) {
-		cout<<  _("Cannot load from file ")<<  pathname<<  "\n";
+		cout<<  _("Cannot load from file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
 
@@ -137,7 +137,7 @@ void save_parameters(const char *filename)
 
  	file.open(pathname, ios::out);
  	if (!file) {
-		cout<<  _("Cannot save to file ")<<  ""<<  pathname<<  "\n";
+		cout<<  _("Cannot save to file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
 
@@ -162,7 +162,7 @@ void load_parameters(const char *filename)
 
  	file.open(pathname, ios::in);
  	if (!file) {
-		cout<<  _("Cannot load from file ")<<  ""<<  pathname<<  "\n";
+		cout<<  _("Cannot load from file")<<  " "<<  pathname<<  "\n";
  		return;
  	}
 
author
#5 lore raw
Quoted 25 lines · Németh Márton
Quoted 24 lines · Chris Ferron
Quoted 13 lines · Németh Márton

Hi Chris,

Quoted 11 lines · Chris Ferron
Quoted 10 lines · Németh Márton

Hi Chris,

I have seen in commit 0e9374d27bfa51b885ee3fe69fbb3b12bdae3600 that the last space of the "Cannot load from file " was removed. This results even in English the following output:

Cannot load from file/var/cache/powertop/saved_parameters.powertop

One solution would be something like this:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
     cout<<    _("Cannot load from file")<<    ""<<    pathname<<    "\n";

Good input thank you. I am still learning about the difficulty's in translation on internationalization.
I will make some adjustments from your input.

See the attached patch what I really ment.

Otherwise it could be also better as I described:

ah ok.
So you would rather see translatable strings that look like this?

Quoted 7 lines
Quoted 6 lines

"PCI Device %s has no runtime power management"

or in this case

"Cannot load from file %s"
?

Yes, I think it is better translatable.

Great, thanks for the input. I will re-work all the string so they are as easy to translate as possible.
-Chris

Quoted 64 lines
Quoted 64 lines
Quoted 62 lines
Quoted 9 lines
Quoted 9 lines

However, in Hungarian this sentence is difficult to translate because of the word order. For example the natural translation of the following English sentence would be:

English: Cannot load from file foo.bar
Hungarian: Nem lehetett a foo.bar fájlból betölteni

Quoted 7 lines
Quoted 7 lines

As you can see in this case it would be better to use the %s format string for printing pathname because this gives better flexibility for the translator to place the pathname string in natural place in a translated sentence.

Regards,

Márton Németh

From: Márton Németh<nm127(a)freemail.hu>

Fix space between localized string and pathname.

Signed-off-by Márton Németh<nm127(a)freemail.hu>

---

src/parameters/persistent.cpp +4 -4
index 47b8824..553cccb 100644
@@ -43,7 +43,7 @@ void save_all_results(const char *filename)
 
   	file.open(pathname, ios::out);
   	if (!file) {
-		cout<<   _("Cannot save to file ")<<   pathname<<   "\n";
+		cout<<   _("Cannot save to file")<<   ""<<   pathname<<   "\n";
   		return;
   	}
   	for (i = 0; i<   past_results.size(); i++) {
@@ -75,7 +75,7 @@ void load_results(const char *filename)
 
   	file.open(pathname, ios::in);
   	if (!file) {
-		cout<<   _("Cannot load from file ")<<   pathname<<   "\n";
+		cout<<   _("Cannot load from file")<<   ""<<   pathname<<   "\n";
   		return;
   	}
 
@@ -137,7 +137,7 @@ void save_parameters(const char *filename)
 
   	file.open(pathname, ios::out);
   	if (!file) {
-		cout<<   _("Cannot save to file ")<<   ""<<   pathname<<   "\n";
+		cout<<   _("Cannot save to file")<<   ""<<   pathname<<   "\n";
   		return;
   	}
 
@@ -162,7 +162,7 @@ void load_parameters(const char *filename)
 
   	file.open(pathname, ios::in);
   	if (!file) {
-		cout<<   _("Cannot load from file ")<<   ""<<   pathname<<   "\n";
+		cout<<   _("Cannot load from file")<<   ""<<   pathname<<   "\n";
   		return;
   	}