Skip to content

Commit e0fbed6

Browse files
committed
l18n
1 parent cb8f87a commit e0fbed6

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
lines changed

src/main/java/com/tang/intellij/lua/luacheck/LuaCheckSettingsPanel.form

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
1414
</constraints>
1515
<properties>
16-
<text value="LuaCheck"/>
16+
<text resource-bundle="LuaBundle" key="ui.luacheck.name"/>
1717
</properties>
1818
</component>
1919
<vspacer id="54015">
@@ -32,7 +32,7 @@
3232
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
3333
</constraints>
3434
<properties>
35-
<text value="Command Line"/>
35+
<text resource-bundle="LuaBundle" key="ui.luacheck.command_line"/>
3636
</properties>
3737
</component>
3838
<component id="f7926" class="com.intellij.ui.RawCommandLineEditor" binding="myCmdLine">

src/main/java/com/tang/intellij/lua/luacheck/LuaCheckSettingsPanel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.intellij.ui.HoverHyperlinkLabel;
2626
import com.intellij.ui.HyperlinkAdapter;
2727
import com.intellij.ui.RawCommandLineEditor;
28+
import com.tang.intellij.lua.LuaBundle;
2829
import org.jetbrains.annotations.Nls;
2930
import org.jetbrains.annotations.NotNull;
3031
import org.jetbrains.annotations.Nullable;
@@ -74,21 +75,20 @@ public boolean isModified() {
7475
}
7576

7677
@Override
77-
public void apply() throws ConfigurationException {
78+
public void apply() {
7879
settings.setLuaCheck(myLuaCheck.getText());
79-
//String[] params = ParametersListUtil.parseToArray(myCmdLine.getText());
8080
settings.setLuaCheckArgs(myCmdLine.getText());
8181
}
8282

8383
private void createUIComponents() {
84-
luaCheckReleasePageLink = new HoverHyperlinkLabel("Download LuaCheck");
84+
luaCheckReleasePageLink = new HoverHyperlinkLabel(LuaBundle.message("ui.luacheck.download"));
8585
luaCheckReleasePageLink.addHyperlinkListener(new HyperlinkAdapter() {
8686
@Override
8787
protected void hyperlinkActivated(HyperlinkEvent hyperlinkEvent) {
8888
BrowserUtil.browse("https://github.com/mpeterv/luacheck/releases");
8989
}
9090
});
91-
commandLineOptionsLink = new HoverHyperlinkLabel("Command line options");
91+
commandLineOptionsLink = new HoverHyperlinkLabel(LuaBundle.message("ui.luacheck.command_line_options"));
9292
commandLineOptionsLink.addHyperlinkListener(new HyperlinkAdapter() {
9393
@Override
9494
protected void hyperlinkActivated(HyperlinkEvent hyperlinkEvent) {

src/main/java/com/tang/intellij/lua/project/LuaAdditionalSourcesRootPanel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptor
2121
import com.intellij.ui.IdeBorderFactory
2222
import com.intellij.ui.ToolbarDecorator
2323
import com.intellij.ui.components.JBList
24+
import com.tang.intellij.lua.LuaBundle
2425
import java.awt.BorderLayout
2526
import javax.swing.DefaultListModel
2627
import javax.swing.JPanel
@@ -37,7 +38,7 @@ class LuaAdditionalSourcesRootPanel : JPanel(BorderLayout()) {
3738
.setEditAction { editPath() }
3839
.setRemoveAction { removePath() }
3940
.createPanel(), BorderLayout.CENTER)
40-
border = IdeBorderFactory.createTitledBorder("Lua additional sources root", false)
41+
border = IdeBorderFactory.createTitledBorder(LuaBundle.message("ui.settings.additional_root"), false)
4142
}
4243

4344
var roots: Array<String> get() {

src/main/java/com/tang/intellij/lua/project/LuaSettingsPanel.form

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
6868
</constraints>
6969
<properties>
70-
<text value="Enable generic"/>
70+
<text resource-bundle="LuaBundle" key="ui.settings.enable_generic"/>
7171
</properties>
7272
</component>
7373
</children>
@@ -110,7 +110,7 @@
110110
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
111111
</constraints>
112112
<properties>
113-
<text value="Show &amp;words in file"/>
113+
<text resource-bundle="LuaBundle" key="ui.settings.show_words"/>
114114
</properties>
115115
</component>
116116
<component id="366e9" class="javax.swing.JCheckBox" binding="recognizeGlobalNameAsCheckBox" default-binding="true">
@@ -145,7 +145,7 @@
145145
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
146146
</constraints>
147147
<properties>
148-
<text value="Type safety"/>
148+
<text resource-bundle="LuaBundle" key="ui.settings.type_safety"/>
149149
</properties>
150150
</component>
151151
<component id="a138e" class="javax.swing.JSeparator">
@@ -161,15 +161,15 @@
161161
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
162162
</constraints>
163163
<properties>
164-
<text value="Enforce type safety"/>
164+
<text resource-bundle="LuaBundle" key="ui.settings.enforce_type_safety"/>
165165
</properties>
166166
</component>
167167
<component id="4e504" class="javax.swing.JCheckBox" binding="nilStrict">
168168
<constraints>
169169
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
170170
</constraints>
171171
<properties>
172-
<text value="Strict nil checks"/>
172+
<text resource-bundle="LuaBundle" key="ui.settings.strict_nil_checks"/>
173173
</properties>
174174
</component>
175175
</children>

src/main/resources/LuaBundle.properties

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,17 @@ inspection.empty_do=Empty do body
2929
inspection.empty_while=Empty while body
3030
run.attach.start_info=Try attach to \"{0}\" pid:{1} with {2} debugger.
3131
run.attach.launch_info=Try launch program:{0} with {1} debugger.
32+
ui.luacheck.command_line=Command Line
33+
ui.luacheck.name=LuaCheck
34+
ui.luacheck.download=Download LuaCheck
35+
ui.luacheck.command_line_options=Command line options
3236
ui.settings.constructor_names=&Constructor names:
3337
ui.settings.strict_doc=Strict &doc
3438
ui.settings.smart_close_end=&Smart close 'end'
35-
ui.settings.show_method_line=show class method line separator
36-
ui.settings.recognize_global_name_as_type=Recognize global name as type
39+
ui.settings.recognize_global_name_as_type=Recognize global name as type
40+
ui.settings.enable_generic=Enable generic
41+
ui.settings.additional_root=Lua additional sources root
42+
ui.settings.show_words=Show &words in file
43+
ui.settings.type_safety=Type safety
44+
ui.settings.enforce_type_safety=Enforce type safety
45+
ui.settings.strict_nil_checks=Strict nil checks

0 commit comments

Comments
 (0)