: eval 'exec perl -wS $0 ${1+"$@"}' if 0; # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This file incorporates work covered by the following license notice: # # 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 . # use warnings; use strict 'vars'; my $my_lang = 'en-US'; my $plist = 'Info.plist'; my $lines = 0; while ($_ = $ARGV[0], /^-/) { shift; last if /^--$/; if (/^-l/) { $my_lang = $ARGV[0]; shift; } elsif (/^-p/) { $plist = $ARGV[0]; shift; } } # open input file (Info.plist) unless (open(SOURCE, $plist)) { print STDERR "Can't open $plist file: $!\n"; return; } # XML::Parser not installed by default on MacOS X my (%documents,$key,$icon,$name); $name = ""; while () { if ( /<\/dict>/ ) { $documents{$icon} = $name if length $name > 0; $key = $icon = $name = ""; } elsif ( /(.*)<\/key>/ ) { $key = $1; } elsif ( /(.*)<\/string>/ ) { if ( $key eq 'CFBundleTypeIconFile' ) { $icon = $1; $icon =~ s/\.icns$//; } elsif ( $key eq 'CFBundleTypeName' ) { $name = $1; } } } close (SOURCE); print_lang($my_lang); print_lang('en-US') unless $lines > 0; sub print_lang { my ($this_lang) = @_; # open input file (documents.ulf) unless (open(SOURCE, $ARGV[0])) { print STDERR "Can't open $ARGV[0] file: $!\n"; return; } my $last_section; while () { if ( /\[(.*)\]/ ) { $last_section = $1; } else { # split locale = "value" into 2 strings my ($lang, $value) = split ' = '; if ( $lang ne $_ && $lang eq $this_lang && exists $documents{$last_section} ) { # replacing product variable doesn't work inside zip files and also not for UTF-16 next if /%PRODUCTNAME/; s/$lang/"$documents{$last_section}"/; s/\n/;\n/; print; $lines += 1; } } } close (SOURCE); } 22.05-testflight'>distro/collabora/co-22.05-testflight LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2021-06-24cross-toolset: fix real cross help buildingJan-Marek Glogowski
2021-06-22configure: Improve help-options handlingJan-Marek Glogowski
2021-06-02no need to allocate these on the heapNoel Grandin
2021-01-02Use GetShortPathNameW workaround on Windows for help indexerMike Kaganski
2021-01-01Use Unicode paths on Windows for help compilerMike Kaganski
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann
2020-11-13tdf#123936 Formatting files in module helpcompiler with clang-formatPhilipp Hofer
2020-11-10tdf#42949 Fix new IWYU warnings in directories [h-r]*Gabor Kelemen
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
2020-04-08loplugin:flatten in helpcompilerNoel Grandin
2019-12-30Avoid -Werror,-Wdeprecated-enum-enum-conversionStephan Bergmann
2019-12-19sal_Char->char in formula..i18npoolNoel Grandin
2019-12-05make some classes module privateNoel Grandin
2019-11-22cid#1448239 unsafe_xml_parse_configCaolán McNamara
2019-11-22cid#1448239 unsafe_xml_parse_configCaolán McNamara
2019-11-22document HelpCompiler::getSourceDocument behaviourCaolán McNamara
2019-11-22fs::getThreadTextEncoding->osl_getThreadTextEncodingCaolán McNamara
2019-11-22drop impl_sleep hackCaolán McNamara
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
2019-11-03make some classes module-privateNoel Grandin
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann
2019-10-11simplify "a = a +" to "a +="Noel Grandin
2019-10-01loplugin:stringadd in helpcompiler..ooxNoel Grandin
2019-07-19cid#1448495 Unchecked return valueCaolán McNamara
2019-07-19cid#1448441 Unchecked return valueCaolán McNamara
2019-07-18cid#703974 Unchecked return valueCaolán McNamara
2019-05-30tdf#42949 Fix IWYU warnings in helpcompiler/Gabor Kelemen
2019-05-22New loplugin:dataStephan Bergmann
2019-04-07std::string has a std::hash specialisation since C++11Noel Grandin
2019-02-24loplugin:unusedfields in helpcompiler..jvmfwkNoel Grandin
2019-02-18use clear() instead of erase(begin, end)Noel Grandin
2019-02-09loplugin:indentation in helpcompiler..ioNoel Grandin
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin
2018-11-21improve function-local statics in forms..reportdesignNoel Grandin
2018-10-23clang-tidy performance-unnecessary-copy-init in editeng..i18npoolNoel Grandin
2018-09-17New loplugin:externalStephan Bergmann
2018-09-09loplugin:simplifyconstruct in helpcompiler..ioNoel Grandin
2018-07-30Add missing sal/log.hxx headersGabor Kelemen
2018-07-27loplugin:returnconstant in helpcompilerNoel Grandin
2018-07-27helpcompiler: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann
2018-06-13Don't create std::string from nullptrStephan Bergmann
2018-06-11tdf#96099 Remove some trivial std::vector typedefsArkadiy Illarionov
2018-06-07tdf#96099 Remove std::vector typedefsAbhyudaya Sharma
2018-04-16loplugin:useuniqueptr in StreamTableNoel Grandin
2018-03-18Use for-range loops in helpcompilerJulien Nabet
2018-02-01helpcompiler: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski
2018-01-15loplugin:useuniqueptr in BasicCodeTaggerNoel Grandin
2017-11-26Replace lists by vector and deque (helpcompiler)Julien Nabet