ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/buildutil/translate/BackportTranslations.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/buildutil/translate/BackportTranslations.java
Status
scanned
Type
file
Name
BackportTranslations.java
Extension
.java
Programming language
Java
Mime type
text/x-c
File type
C source, ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2651 (2.6 KB)
MD5
c2547c0ed2ec5e6bd85eb1c95d772486
SHA1
5c2f9bc0a07d4e95f792bd47ec94c3fa4ac2190d
SHA256
0034244b2365cea3990428e36faa524c7bef0d00b52dad89878db7227cde800e
SHA512

      
    
SHA1_git
8fd8d71b392753289782f86939c3ddec1373d4b7
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
BackportTranslations.java | 2.6 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.buildutil.translate; import java.io.IOException; import java.util.Properties; /** * Generates a set of translated property files to back-port updates to a previous version. If the source and target use * the same value for the English key then any translated value for that key is copied from the source to the target. */ public class BackportTranslations extends BackportBase { public static void main(String... args) throws IOException { BackportTranslations backport = new BackportTranslations(args); backport.execute(); } protected BackportTranslations(String[] args) throws IOException { super(args); } @Override protected void execute() throws IOException { for (String language : targetTranslations.keySet()) { // Skip source if (language.isEmpty()) { continue; } Properties sourceTranslated = sourceTranslations.get(language); Properties targetTranslated = targetTranslations.get(language); if (targetTranslated == null) { targetTranslated = new Properties(); targetTranslations.put(language, targetTranslated); } for (Object key : targetEnglish.keySet()) { if (sourceTranslated.containsKey(key) && targetEnglish.get(key).equals(sourceEnglish.get(key))) { targetTranslated.put(key, sourceTranslated.get(key)); } } // Remove translated values for keys that have been removed targetTranslated.entrySet().removeIf(entry -> !targetEnglish.containsKey(entry.getKey())); Utils.export(language, targetTranslated, storageDir); } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
42.2
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9