You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/07/30 14:26:20 UTC

[tomcat] 02/04: Align with master: i18n improvements

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit e2943ad6010cfdecc0fae7c0a31cf21cdff25f49
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jul 30 15:13:35 2019 +0100

    Align with master: i18n improvements
---
 .../org/apache/catalina/filters/ExpiresFilter.java |  5 +-
 .../catalina/filters/LocalStrings.properties       |  6 ++
 .../catalina/filters/LocalStrings_es.properties    | 11 +++-
 .../catalina/filters/LocalStrings_fr.properties    | 49 ++++++++++++++++
 .../catalina/filters/LocalStrings_ja.properties    | 65 ++++++++++++++++++++++
 ...gs_fr.properties => LocalStrings_ru.properties} |  6 +-
 .../apache/catalina/filters/RemoteIpFilter.java    |  8 ++-
 .../apache/catalina/filters/WebdavFixFilter.java   | 14 ++---
 8 files changed, 146 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/catalina/filters/ExpiresFilter.java b/java/org/apache/catalina/filters/ExpiresFilter.java
index 6f6915d..c791dff 100644
--- a/java/org/apache/catalina/filters/ExpiresFilter.java
+++ b/java/org/apache/catalina/filters/ExpiresFilter.java
@@ -1071,9 +1071,8 @@ public class ExpiresFilter extends FilterBase {
             try {
                 ints[i] = Integer.parseInt(intAsString);
             } catch (NumberFormatException e) {
-                throw new RuntimeException("Exception parsing number '" + i +
-                        "' (zero based) of comma delimited list '" +
-                        commaDelimitedInts + "'");
+                throw new RuntimeException(sm.getString("expiresFilter.numberError",
+                        Integer.valueOf(i), commaDelimitedInts));
             }
         }
         return ints;
diff --git a/java/org/apache/catalina/filters/LocalStrings.properties b/java/org/apache/catalina/filters/LocalStrings.properties
index 31f6e85..41a4bef 100644
--- a/java/org/apache/catalina/filters/LocalStrings.properties
+++ b/java/org/apache/catalina/filters/LocalStrings.properties
@@ -34,6 +34,7 @@ expiresFilter.noDurationFound=Duration not found in directive [{0}]
 expiresFilter.noDurationUnitAfterAmount=Duration unit not found after amount [{0}] in directive [{1}]
 expiresFilter.noExpirationConfigured=Request [{0}] with response status [{1}] content-type [{2}], no expiration configured
 expiresFilter.noExpirationConfiguredForContentType=No Expires configuration found for content-type [{0}]
+expiresFilter.numberError=Exception parsing number at position [{0}] (zero based) in comma delimited list [{1}]
 expiresFilter.responseAlreadyCommited=Request [{0}], cannot apply ExpiresFilter on already committed response.
 expiresFilter.setExpirationDate=Request [{0}] with response status [{1}] content-type [{2}], set expiration date [{3}]
 expiresFilter.skippedStatusCode=Request [{0}] with response status [{1}] content-type [{1}], skip expiration header generation for given status
@@ -54,6 +55,11 @@ httpHeaderSecurityFilter.committed=Unable to add HTTP headers since response is
 remoteCidrFilter.invalid=Invalid configuration provided for [{0}]. See previous messages for details.
 remoteCidrFilter.noRemoteIp=Client does not have an IP address. Request denied.
 
+remoteIpFilter.invalidNumber=Illegal number for parameter [{0}]: [{1}]
+
 requestFilter.deny=Denied request for [{0}] based on property [{1}]
 
 restCsrfPreventionFilter.invalidNonce=CSRF nonce validation failed
+
+webDavFilter.xpProblem=WebdavFixFilter: the XP-x64-SP2 client is known not to work with WebDAV Servlet
+webDavFilter.xpRootContext=WebdavFixFilter: the XP-x64-SP2 client will only work with the root context
diff --git a/java/org/apache/catalina/filters/LocalStrings_es.properties b/java/org/apache/catalina/filters/LocalStrings_es.properties
index b6611ad..cf6199c 100644
--- a/java/org/apache/catalina/filters/LocalStrings_es.properties
+++ b/java/org/apache/catalina/filters/LocalStrings_es.properties
@@ -15,7 +15,10 @@
 
 addDefaultCharset.unsupportedCharset=El conjunto especificado de caracteres [{0}] no se encuentra soportado
 
-csrfPrevention.invalidRandomClass=No pude crear fuente al azar usando la clase [{0}]
+corsFilter.invalidPreflightMaxAge=Incapáz de procesar preflightMaxAge
+corsFilter.nullRequestType=Objeto CORSRequestType es nulo\n
+
+csrfPrevention.invalidRandomClass=No se puede crear fuente aleatórea usando la clase [{0}]
 
 expiresFilter.exceptionProcessingParameter=Excepción al procesar parámetro de configuración [{0}]:[{1}]
 expiresFilter.expirationHeaderAlreadyDefined=Ya se ha definido cabecera de expiración para el requerimiento [{0}] con status de respuesta [{1}] y content-type [{2}]
@@ -28,10 +31,14 @@ expiresFilter.skippedStatusCode=Generación de cabecera de expiración saltada p
 expiresFilter.startingPointInvalid=Punto de arranque inválido (access|now|modification|a<seconds>|m<seconds>) [{0}] en la directiva [{1}]
 expiresFilter.startingPointNotFound=Punto de Arranque (access|now|modification|a<seconds>|m<seconds>) no hallado en la directiva [{0}]
 expiresFilter.unknownParameterIgnored=¡Se ignora el parámetro desconocido [{0}] con valor [{1}] especificado!
-expiresFilter.unsupportedStartingPoint=No soportado startingPoint [{0}]
+expiresFilter.unsupportedStartingPoint=startingPoint [{0}] no soportado
 expiresFilter.useDefaultConfiguration=El uso de [{0}] por defecto para content-type [{1}] devuelve [{2}]
 expiresFilter.useMatchingConfiguration=El Uso de [{0}] coincidente con [{1}] para content-type [{2}] devuelve [{3}]
 
 filterbase.noSuchProperty=La propiedad [{0}] no está definida para los filtros del tipo [{1}]
 
 http.403=El acceso al recurso especificado [{0}] ha sido prohibido.
+
+httpHeaderSecurityFilter.clickjack.invalid=An invalid value [{0}] was specified for the anti click-jacking header
+
+requestFilter.deny=Solicitud [{0}] denegada debido a propiedad [{1}]
diff --git a/java/org/apache/catalina/filters/LocalStrings_fr.properties b/java/org/apache/catalina/filters/LocalStrings_fr.properties
index 47f0f56..e2bfee6 100644
--- a/java/org/apache/catalina/filters/LocalStrings_fr.properties
+++ b/java/org/apache/catalina/filters/LocalStrings_fr.properties
@@ -13,4 +13,53 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+addDefaultCharset.unsupportedCharset=Le jeu de caractères [{0}] spécifié n''est pas supporté
+
+corsFilter.invalidPreflightMaxAge=Incapable d'analyser "preflightMaxAge"
+corsFilter.invalidSupportsCredentials=Il est interdit de configurer supportsCredentials=[true] alors que allowedOrigins=[*]
+corsFilter.nullRequest=L'objet HttpServletRequest est nul
+corsFilter.nullRequestType=L'objet CORSRequestType est nul
+corsFilter.onlyHttp=CORS ne supporte pas des requêtes ou des réponses non HTTP
+corsFilter.wrongType1=Attente d''un objet HttpServletRequest de type [{0}]
+corsFilter.wrongType2=Attendu un object HttpServletRequest de type [{0}] ou [{1}]
+
+csrfPrevention.invalidRandomClass=Impossible de créer une source aléatoire ("Random source") à l''aide de la classe [{0}]
+
+expiresFilter.exceptionProcessingParameter=Erreur lors du traitement du paramètre de configuration [{0}]:[{1}]
+expiresFilter.expirationHeaderAlreadyDefined=Requête [{0}] de statut de réponse [{1}] et de type de contenu ("content-type") [{2}], en-tête d''expiration déjà défini
+expiresFilter.filterInitialized=Le filtre a été initialisé avec la configuration [{0}]
+expiresFilter.invalidDurationNumber=Durée (nombre) invalide [{0}] dans la directive [{1}]
+expiresFilter.invalidDurationUnit=Unité de durée invalide (years|months|weeks|days|hours|minutes|seconds) [{0}] dans la directive [{1}]
+expiresFilter.noDurationFound=La durée n''a pas été trouvée dans la directive [{0}]
+expiresFilter.noDurationUnitAfterAmount=L''unité de durée n''a pas été trouvée après le nombre [{0}] dans la directive [{1}]
+expiresFilter.noExpirationConfigured=Requête [{0}] avec statut de réponse [{1}] et content-type [{2}], pas d''expiration configurée
+expiresFilter.noExpirationConfiguredForContentType=La configuration "Expires" pour le type de contenu [{0}] n''est pas trouvée.
+expiresFilter.numberError=Erreur lors de l''analyse du nombre à la position [{0}] (basée sur zéro) de la liste délimitée par une virgule [{1}]
+expiresFilter.responseAlreadyCommited=Impossible d''appliquer le ExpiresFilter pour la requête [{0}] car la réponse a déjà été envoyée
+expiresFilter.setExpirationDate=La requête [{0}] avec le status de réponse [{1}] content-type [{2}], a fixé la date d''expiration [{3}]
+expiresFilter.skippedStatusCode=La requête [{0}] avec le code de réponse [{1}] content-type [{2}], l''en-tête expiration ne sera pas généré pour ce statut
+expiresFilter.startingPointInvalid=Point de départ invalide (access|now|modification|a<secondes>|m<secondes>) [{0}] dans la directive [{1}]\n
+expiresFilter.startingPointNotFound=Le point de départ (access|now|modification|a<seconds>|m<seconds>) n''est pas présent dans la directive [{0}]
+expiresFilter.unknownParameterIgnored=Le paramètre inconnu [{0}] dont la valeur est [{1}] est ignoré
+expiresFilter.unsupportedStartingPoint=startingPoint [{0}] non supporté.
+expiresFilter.useDefaultConfiguration=Utilisation du défaut [{0}] pour le content-type [{1}] qui renvoie [{2}]
+expiresFilter.useMatchingConfiguration=Utilisation de [{0}], satisfaisant [{1}] pour le content-type [{2}] et retournant [{3}]
+
+filterbase.noSuchProperty=La propriété [{0}] n''est pas définie pour les filtres du type [{1}]
+
 http.403=L''accès à la ressource demandée [{0}] a été interdit.
+
+httpHeaderSecurityFilter.clickjack.invalid=Une valeur invalide [{0}] a été spécifiée pour le header "anti click-jacking"
+httpHeaderSecurityFilter.committed=Impossible d'ajouter les en-têtes HTTP car la réponse a déjà été envoyée avant l'invocation du filtre de sécurité des en-têtes
+
+remoteCidrFilter.invalid=Une configuration invalide a été fournie pour [{0}], voir les précédents messages pour les détails
+remoteCidrFilter.noRemoteIp=Le client n'a pas d'adresse IP.  Requête rejetée.
+
+remoteIpFilter.invalidNumber=Nombre invalide pour le paramètre [{0}]: [{1}]
+
+requestFilter.deny=Requête refusée pour [{0}] basée sur la propriété [{1}]
+
+restCsrfPreventionFilter.invalidNonce=La validation du nonce de CSRF a échouée
+
+webDavFilter.xpProblem=WebdavFixFilter: le client de XP-x64-SP2 est réputé ne pas fonctionner avec le Servlet WebDAV
+webDavFilter.xpRootContext=WebdavFixFilter: le client de XP-x64-SP2 ne peut fonctionner que le le contexte racine
diff --git a/java/org/apache/catalina/filters/LocalStrings_ja.properties b/java/org/apache/catalina/filters/LocalStrings_ja.properties
new file mode 100644
index 0000000..1f6de03
--- /dev/null
+++ b/java/org/apache/catalina/filters/LocalStrings_ja.properties
@@ -0,0 +1,65 @@
+# 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.
+
+addDefaultCharset.unsupportedCharset=指定された文字セット[{0}]はサポートされていません。
+
+corsFilter.invalidPreflightMaxAge=preflightMaxAgeを解析出来ません
+corsFilter.invalidSupportsCredentials=allowedOrigins = [*]の場合、supportsCredentials = [true]を設定することはできません。
+corsFilter.nullRequest=HttpServletRequestオブジェクトがnullです
+corsFilter.nullRequestType=CORSRequestType オブジェクトが null です。
+corsFilter.onlyHttp=CORSは非HTTPリクエストまたはレスポンスをサポートしていません。
+corsFilter.wrongType1=[{0}]型のHttpServletRequestオブジェクトが必要です
+corsFilter.wrongType2=[{0}]型または[{1}]型のHttpServletRequest オブジェクトが必要です。
+
+csrfPrevention.invalidRandomClass=乱数生成器クラス [{0}] のインスタンスが作成できませんでした。
+
+expiresFilter.exceptionProcessingParameter=構成パラメータ[{0}]:[{1}]処理中の例外
+expiresFilter.expirationHeaderAlreadyDefined=レスポンスステータス[{1}]がコンテンツタイプ[{2}]のリクエスト[{0}、expirationヘッダーがすでに定義されています。
+expiresFilter.filterInitialized=設定[{0}]で初期化されたFilter
+expiresFilter.invalidDurationNumber=ディレクティブ[{1}]の無効な期間(number)[{0}]
+expiresFilter.invalidDurationUnit=  ディレクティブ[{1}]で期間ユニットが無効です。(years|months|weeks|days|hours|minutes|seconds) [{0}] \n
+expiresFilter.noDurationFound=ディレクティブ[{0}]にDuration が見つかりません
+expiresFilter.noDurationUnitAfterAmount=ディレクティブ[{1}]のamount[{0}]の後にDuration 単位が見つかりません。
+expiresFilter.noExpirationConfigured=リクエスト [{0}] に対するレスポンスは応答コード [{1} コンテントタイプ [{2}] です。有効期限は未設定です。
+expiresFilter.noExpirationConfiguredForContentType=Content-Type [{0}] に有効期限が設定されていません。
+expiresFilter.numberError=カンマ区切りリスト [{1}] の [{0}] 番目(ゼロ開始)の数値を解析中の例外
+expiresFilter.responseAlreadyCommited=リクエスト[{0}]は、すでにコミットされたレスポンスに対してExpiresFilterを適用できません。
+expiresFilter.setExpirationDate=レスポンスステータス[{1}]のコンテンツタイプ[{2}]、有効期限[{3}]を設定するリクエスト[{0}]
+expiresFilter.skippedStatusCode=レスポンスステータス[{1}] content-type [{1}]のリクエスト[{0}]、指定されたステータスのexpiration ヘッダーの生成をスキップします。
+expiresFilter.startingPointInvalid=ディレクティブ[{1}]の無効な開始点(access|now|modification|a<seconds>|m<seconds>)[{0}]
+expiresFilter.startingPointNotFound=ディレクティブ[{0}]に開始点(access|now|modification|a<seconds>|m<seconds>)が見つかりません
+expiresFilter.unknownParameterIgnored=値[{1}]を持つ未知のパラメータ[{0}]は無視されます!
+expiresFilter.unsupportedStartingPoint=[{0}] は未対応の開始点です。
+expiresFilter.useDefaultConfiguration=コンテンツタイプ[{1}]にデフォルト[{0}]を使用すると[{2}]が返されます。
+expiresFilter.useMatchingConfiguration=content-type[{2}]が[{3}]を返すため、[{1}]と一致する[{0}]を使用します
+
+filterbase.noSuchProperty=[{1}]タイプのフィルタにはプロパティ[{0}]が定義されていません。
+
+http.403=指定されたリソース [{0}] へのアクセスは拒否されました。
+
+httpHeaderSecurityFilter.clickjack.invalid=アンチクリックジャッキングヘッダーに不正な値 [{0}] が指定されました。
+httpHeaderSecurityFilter.committed=HTTPヘッダーセキュリティフィルターへの入力時に既に応答がコミットされているため、HTTPヘッダーを追加できません。
+
+remoteCidrFilter.invalid=[{0}] に不正な値が指定されました。詳細は直前のメッセージを参照してください。
+remoteCidrFilter.noRemoteIp=クライアントは IP アドレスを持っていません。リクエストを拒否します。
+
+remoteIpFilter.invalidNumber=パラメータ[{0}]: [{1}]に不正な番号があります。
+
+requestFilter.deny=プロパティ [{1}] に従い  [{0}] へのリクエストを拒否しました。
+
+restCsrfPreventionFilter.invalidNonce=CSRF nonce の検証に失敗しました。
+
+webDavFilter.xpProblem=WebdavFixFilter:XP-x64-SP2クライアントはWebDAVサーブレットで動作しないことが知られています
+webDavFilter.xpRootContext=WebdavFixFilter:XP-x64-SP2クライアントはルートコンテキストでのみ動作します
diff --git a/java/org/apache/catalina/filters/LocalStrings_fr.properties b/java/org/apache/catalina/filters/LocalStrings_ru.properties
similarity index 71%
copy from java/org/apache/catalina/filters/LocalStrings_fr.properties
copy to java/org/apache/catalina/filters/LocalStrings_ru.properties
index 47f0f56..07bc422 100644
--- a/java/org/apache/catalina/filters/LocalStrings_fr.properties
+++ b/java/org/apache/catalina/filters/LocalStrings_ru.properties
@@ -13,4 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-http.403=L''accès à la ressource demandée [{0}] a été interdit.
+corsFilter.invalidPreflightMaxAge=Невозможно обработать значение preflightMaxAge
+
+csrfPrevention.invalidRandomClass=Невозможно создать Случайный источник с помощью [{0}]
+
+http.403=Доступ к ресурсу [{0}] был запрещён.
diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 5053f76..a0dee98 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -49,6 +49,7 @@ import org.apache.catalina.connector.RequestFacade;
 import org.apache.catalina.servlet4preview.http.PushBuilder;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
 
 /**
  * <p>
@@ -672,7 +673,8 @@ public class RemoteIpFilter implements Filter {
 
     // Log must be non-static as loggers are created per class-loader and this
     // Filter may be used in multiple class loaders
-    private final Log log = LogFactory.getLog(RemoteIpFilter.class); // must not be static
+    private final Log log = LogFactory.getLog(RemoteIpFilter.class);
+    protected static final StringManager sm = StringManager.getManager(RemoteIpFilter.class);
 
     protected static final String PROTOCOL_HEADER_PARAMETER = "protocolHeader";
 
@@ -1033,7 +1035,7 @@ public class RemoteIpFilter implements Filter {
             try {
                 setHttpServerPort(Integer.parseInt(filterConfig.getInitParameter(HTTP_SERVER_PORT_PARAMETER)));
             } catch (NumberFormatException e) {
-                throw new NumberFormatException("Illegal " + HTTP_SERVER_PORT_PARAMETER + " : " + e.getMessage());
+                throw new NumberFormatException(sm.getString("remoteIpFilter.invalidNumber", HTTP_SERVER_PORT_PARAMETER, e.getLocalizedMessage()));
             }
         }
 
@@ -1041,7 +1043,7 @@ public class RemoteIpFilter implements Filter {
             try {
                 setHttpsServerPort(Integer.parseInt(filterConfig.getInitParameter(HTTPS_SERVER_PORT_PARAMETER)));
             } catch (NumberFormatException e) {
-                throw new NumberFormatException("Illegal " + HTTPS_SERVER_PORT_PARAMETER + " : " + e.getMessage());
+                throw new NumberFormatException(sm.getString("remoteIpFilter.invalidNumber", HTTPS_SERVER_PORT_PARAMETER, e.getLocalizedMessage()));
             }
         }
     }
diff --git a/java/org/apache/catalina/filters/WebdavFixFilter.java b/java/org/apache/catalina/filters/WebdavFixFilter.java
index e00d2ce..ce9630d 100644
--- a/java/org/apache/catalina/filters/WebdavFixFilter.java
+++ b/java/org/apache/catalina/filters/WebdavFixFilter.java
@@ -27,6 +27,8 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.tomcat.util.res.StringManager;
+
 /**
  * Filter that attempts to force MS WebDAV clients connecting on port 80 to use
  * a WebDAV client that actually works. Other workarounds that might help
@@ -59,8 +61,7 @@ import javax.servlet.http.HttpServletResponse;
  */
 public class WebdavFixFilter implements Filter {
 
-    private static final String LOG_MESSAGE_PREAMBLE =
-        "WebdavFixFilter: Detected client problem: ";
+    protected static final StringManager sm = StringManager.getManager(WebdavFixFilter.class);
 
     /* Start string for all versions */
     private static final String UA_MINIDIR_START =
@@ -110,11 +111,11 @@ public class WebdavFixFilter implements Filter {
         } else if (ua.startsWith(UA_MINIDIR_5_2_3790)) {
             // XP 64-bit SP2
             if (!"".equals(httpRequest.getContextPath())) {
-                log(httpRequest, "XP-x64-SP2 clients only work with the root context");
+                request.getServletContext().log(sm.getString("webDavFilter.xpRootContext"));
             }
             // Namespace issue maybe
             // see http://greenbytes.de/tech/webdav/webdav-redirector-list.html
-            log(httpRequest, "XP-x64-SP2 is known not to work with WebDAV Servlet");
+            request.getServletContext().log(sm.getString("webDavFilter.xpProblem"));
 
             chain.doFilter(request, response);
         } else {
@@ -140,9 +141,4 @@ public class WebdavFixFilter implements Filter {
         return location.toString();
     }
 
-    private void log(ServletRequest request, String msg) {
-        StringBuilder builder = new StringBuilder(LOG_MESSAGE_PREAMBLE);
-        builder.append(msg);
-        request.getServletContext().log(builder.toString());
-    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org