Blame SOURCES/TestTranslations.java

5caa27
/* TestTranslations -- Ensure translations are available for new timezones
5caa27
   Copyright (C) 2022 Red Hat, Inc.
5caa27
5caa27
This program is free software: you can redistribute it and/or modify
5caa27
it under the terms of the GNU Affero General Public License as
5caa27
published by the Free Software Foundation, either version 3 of the
5caa27
License, or (at your option) any later version.
5caa27
5caa27
This program is distributed in the hope that it will be useful,
5caa27
but WITHOUT ANY WARRANTY; without even the implied warranty of
5caa27
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5caa27
GNU Affero General Public License for more details.
5caa27
5caa27
You should have received a copy of the GNU Affero General Public License
5caa27
along with this program.  If not, see <http://www.gnu.org/licenses/>.
5caa27
*/
5caa27
5caa27
import java.util.Arrays;
5caa27
import java.util.Locale;
5caa27
import java.util.ResourceBundle;
5caa27
5caa27
import sun.util.resources.LocaleData;
5caa27
import sun.util.locale.provider.LocaleProviderAdapter;
5caa27
5caa27
public class TestTranslations {
5caa27
    public static void main(String[] args) {
5caa27
        for (String zone : args) {
5caa27
            System.out.printf("Translations for %s\n", zone);
5caa27
            for (Locale l : Locale.getAvailableLocales()) {
5caa27
                ResourceBundle bundle = new LocaleData(LocaleProviderAdapter.Type.JRE).getTimeZoneNames(l);
5caa27
                System.out.printf("Locale: %s, language: %s, translations: %s\n", l, l.getDisplayLanguage(), Arrays.toString(bundle.getStringArray(zone)));
5caa27
            }
5caa27
        }
5caa27
    }
5caa27
}