Changeset 13502 in josm for trunk/src/org
- Timestamp:
- 2018-03-04T18:16:19+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r13314 r13502 67 67 import org.openstreetmap.josm.spi.preferences.Config; 68 68 import org.openstreetmap.josm.tools.CheckParameterUtil; 69 import org.openstreetmap.josm.tools.I18n; 69 70 import org.openstreetmap.josm.tools.Logging; 70 71 import org.openstreetmap.josm.tools.MultiMap; … … 743 744 InputStream s = zip != null ? zip : cache.getInputStream(); 744 745 Reader reader = new BufferedReader(UTFInputStreamReader.create(s))) { 746 if (zip != null) 747 I18n.addTextsZip(cache.getFile()); 745 748 result = TagCheck.readMapCSS(reader); 746 749 checks.remove(url); -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r13493 r13502 22 22 import java.util.jar.JarInputStream; 23 23 import java.util.zip.ZipEntry; 24 import java.util.zip.ZipFile; 24 25 25 26 /** … … 367 368 } 368 369 370 /** 371 * I18n initialization for plugins. 372 * @param source file path/name of the JAR file containing translation strings 373 * @since 4159 374 */ 369 375 public static void addTexts(File source) { 370 376 if ("en".equals(loadedCode)) … … 398 404 } 399 405 } 406 } catch (IOException | InvalidPathException e) { 407 Logging.trace(e); 408 } 409 } 410 411 /** 412 * I18n initialization for Zip based resources. 413 * @param source input Zip source 414 * @since xxx 415 */ 416 public static void addTextsZip(File source) { 417 if ("en".equals(loadedCode)) 418 return; 419 final ZipEntry enfile = new ZipEntry("data/en.lang"); 420 final ZipEntry langfile = new ZipEntry("data/"+loadedCode+".lang"); 421 try ( 422 ZipFile zipFile = new ZipFile(source, StandardCharsets.UTF_8); 423 InputStream orig = zipFile.getInputStream(enfile); 424 InputStream trans = zipFile.getInputStream(langfile); 425 ) { 426 if (orig != null && trans != null) 427 load(orig, trans, true); 400 428 } catch (IOException | InvalidPathException e) { 401 429 Logging.trace(e);
Note:
See TracChangeset
for help on using the changeset viewer.