@@ -0,0 +1,2742 @@
+/*%0A* Licensed to the Apache Software Foundation (ASF) under one or more%0A* contributor license agreements.  See the NOTICE file distributed with%0A* this work for additional information regarding copyright ownership.%0A* The ASF licenses this file to You under the Apache License, Version 2.0%0A* (the %22License%22); you may not use this file except in compliance with%0A* the License.  You may obtain a copy of the License at%0A*%0A*     http://www.apache.org/licenses/LICENSE-2.0%0A*%0A* Unless required by applicable law or agreed to in writing, software%0A* distributed under the License is distributed on an %22AS IS%22 BASIS,%0A* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A* See the License for the specific language governing permissions and%0A* limitations under the License.%0A*/%0Apackage org.apache.tomcat.buildutil.translate;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.Properties;%0A%0A/**%0A * Generates a set of English property files to back-port updates to a previous%0A * version. Where a key exists in the source and target versions the value is%0A * copied from the source to the target, overwriting the value in the target.%0A * The expectation is that the changes will be manually reviewed before%0A * committing them.%0A */%0Apublic class BackportEnglish %7B%0A%0A    private static final Map%3CString,Properties%3E sourceTranslations = new HashMap%3C%3E();%0A    private static final Map%3CString,Properties%3E targetTranslations = new HashMap%3C%3E();%0A%0A    public static void main(String... args) throws IOException %7B%0A        if (args.length != 1) %7B%0A            throw new IllegalArgumentException(%22Missing back-port target%22);%0A        %7D%0A        File targetRoot = new File(args%5B0%5D);%0A%0A        if (!targetRoot.isDirectory()) %7B%0A            throw new IllegalArgumentException(%22Back-port target not a directory%22);%0A        %7D%0A%0A        File sourceRoot = new File(%22.%22);%0A        for (String dir : Constants.SEARCH_DIRS) %7B%0A            File directory = new File(dir);%0A            Utils.processDirectory(sourceRoot, directory, sourceTranslations);%0A        %7D%0A%0A        for (String dir : Constants.SEARCH_DIRS) %7B%0A            File directory = new File(targetRoot, dir);%0A            Utils.processDirectory(targetRoot, directory, targetTranslations);%0A        %7D%0A%0A        Properties sourceEnglish = sourceTranslations.get(%22%22);%0A        Properties targetEnglish = targetTranslations.get(%22%22);%0A%0A        for (Object key : sourceEnglish.keySet()) %7B%0A            if (targetEnglish.containsKey(key)) %7B%0A                targetEnglish.put(key, sourceEnglish.get(key));%0A            %7D%0A        %7D%0A%0A        File storageDir = new File(targetRoot, Constants.STORAGE_DIR);%0A%0A        Utils.export(%22%22, targetEnglish, storageDir);%0A    %7D%0A%7D%0A

Add a tool for back-porting English translations