Skip to content

Commit 532f2f5

Browse files
committed
1C-Company#103 Экстернализация сообщений
1 parent 3d8df46 commit 532f2f5

File tree

5 files changed

+82
-4
lines changed

5 files changed

+82
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
eclipse.preferences.version=1
2+
encoding//src/com/e1c/ssl/bsl/check/messages_ru.properties=UTF-8
23
encoding/<project>=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*******************************************************************************
2+
* Copyright (C) 2023, 1C-Soft LLC and others.
3+
*
4+
* This program and the accompanying materials are made
5+
* available under the terms of the Eclipse Public License 2.0
6+
* which is available at https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* 1C-Soft LLC - initial API and implementation
12+
*******************************************************************************/
13+
14+
package com.e1c.ssl.bsl.check;
15+
16+
import org.eclipse.osgi.util.NLS;
17+
18+
/**
19+
* The Class Messages.
20+
* @author Vadim Goncharov
21+
*/
22+
public class Messages
23+
extends NLS
24+
{
25+
private static final String BUNDLE_NAME = "com.e1c.ssl.bsl.check.messages"; //$NON-NLS-1$
26+
27+
public static String UsersRolesAvailableRolesExistCheck_description;
28+
public static String UsersRolesAvailableRolesExistCheck_Role_not_exist;
29+
public static String UsersRolesAvailableRolesExistCheck_title;
30+
31+
static
32+
{
33+
// initialize resource bundle
34+
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
35+
}
36+
37+
private Messages()
38+
{
39+
}
40+
}

bundles/com.e1c.ssl.bsl/src/com/e1c/ssl/bsl/check/UsersRolesAvailableRolesExistCheck.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public String getCheckId()
9090
protected void configureCheck(CheckConfigurer builder)
9191
{
9292
//TODO добавить extension CommonSenseCheckExtension
93-
builder.title("Users.RolesAvailabel() role exist") //TODO add NLS String
94-
.description("Users.RolesAvailabel() role exist") //TODO add NLS String
93+
builder.title(Messages.UsersRolesAvailableRolesExistCheck_title)
94+
.description(Messages.UsersRolesAvailableRolesExistCheck_description)
9595
.complexity(CheckComplexity.NORMAL)
9696
.severity(IssueSeverity.MAJOR)
9797
.issueType(IssueType.WARNING)
@@ -135,8 +135,7 @@ protected void check(Object object, ResultAcceptor resultAcceptor, ICheckParamet
135135
String fqn = topObjectFqnGenerator.generateStandaloneObjectFqn(ROLE, role);
136136
if (scope.getSingleElement(qualifiedNameConverter.toQualifiedName(fqn)) == null)
137137
{
138-
//TODO add NLS String
139-
String message = MessageFormat.format("Role {0} not exist", role);
138+
String message = MessageFormat.format(Messages.UsersRolesAvailableRolesExistCheck_Role_not_exist, role);
140139
resultAcceptor.addIssue(message, literal, STRING_LITERAL__LINES);
141140
}
142141

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
2+
###############################################################################
3+
# Copyright (C) 2023, 1C-Soft LLC and others.
4+
#
5+
# This program and the accompanying materials are made
6+
# available under the terms of the Eclipse Public License 2.0
7+
# which is available at https://www.eclipse.org/legal/epl-2.0/
8+
#
9+
# SPDX-License-Identifier: EPL-2.0
10+
#
11+
# Contributors:
12+
# 1C-Soft LLC - initial API and implementation
13+
###############################################################################
14+
15+
UsersRolesAvailableRolesExistCheck_Role_not_exist = Role {0} not exist
16+
17+
UsersRolesAvailableRolesExistCheck_description = Users.RolesAvailabel() - role exist
18+
19+
UsersRolesAvailableRolesExistCheck_title = Users.RolesAvailabel() - role exist
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
2+
###############################################################################
3+
# Copyright (C) 2023, 1C-Soft LLC and others.
4+
#
5+
# This program and the accompanying materials are made
6+
# available under the terms of the Eclipse Public License 2.0
7+
# which is available at https://www.eclipse.org/legal/epl-2.0/
8+
#
9+
# SPDX-License-Identifier: EPL-2.0
10+
#
11+
# Contributors:
12+
# 1C-Soft LLC - initial API and implementation
13+
###############################################################################
14+
15+
UsersRolesAvailableRolesExistCheck_Role_not_exist = Роль {0} не существует
16+
17+
UsersRolesAvailableRolesExistCheck_description = Пользователи.РолиДоступны() - роль существует
18+
19+
UsersRolesAvailableRolesExistCheck_title = Пользователи.РолиДоступны() - роль существует

0 commit comments

Comments
 (0)