#15298 closed enhancement (fixed)
Use rpm return value instead of localized message
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | normal | Milestone: | 17.09 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
From src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java:
// rpm returns translated string "package %s is not installed\n", can't find a way to force english output // translations from https://github.com/rpm-software-management/rpm private static final String[] NOT_INSTALLED = { "not installed", // en "no s'ha instal·lat", // ca "尚未安裝", // cmn ...
rpm respects locales:
$ rpm -q test balíček test není nainstalován $ LANG=en rpm -q test package test is not installed $ LANG=POSIX rpm -q test package test is not installed
So just set the environment variable to POSIX (or to en) and you are done.
Attachments (0)
Change History (12)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
WTH is this bug report, you mean? We cannot control the locale set by all JOSM users.
comment:3 by , 7 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
But you can control locale of rpm.
Or you can use rpm return value.
comment:4 by , 7 years ago
Milestone: | → 17.09 |
---|---|
Summary: | WTH is String[] NOT_INSTALLED ? → Use rpm return value instead of localized message |
Type: | defect → enhancement |
OK. But please avoid tickets with such titles...
comment:5 by , 7 years ago
Summary: | Use rpm return value instead of localized message → WTH is String[] NOT_INSTALLED ? |
---|---|
Type: | enhancement → defect |
It was so funny when I saw it, that I though the author cannot really mean it.
So FWIW:
import java.io.IOException; class env { public static void main(String args[]) { try { ProcessBuilder pb = new ProcessBuilder().inheritIO().command( new String[] {"rpm", "-q", "test"}); pb.environment().put("LANG", "POSIX"); Process p = pb.start(); } catch (IOException e) { System.err.println(e); } } }
comment:6 by , 7 years ago
Summary: | WTH is String[] NOT_INSTALLED ? → Use rpm return value instead of localized message (was: WTH is String[] NOT_INSTALLED ?) |
---|
oops
comment:7 by , 7 years ago
Keywords: | java9 added |
---|
comment:8 by , 7 years ago
Keywords: | java9 removed |
---|---|
Type: | defect → enhancement |
comment:9 by , 7 years ago
Summary: | Use rpm return value instead of localized message (was: WTH is String[] NOT_INSTALLED ?) → Use rpm return value instead of localized message |
---|
comment:10 by , 7 years ago
Well keep in mind we have a lot of bug reports to handle, and this kind of titles is not funny for us. Thanks for reporting it.
Or even better, use the return value of rpm.