PY-18792 Move messages into PyBundle
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Fri, 27 May 2016 11:03:20 +0000 (14:03 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Wed, 15 Jun 2016 16:34:12 +0000 (19:34 +0300)
python/src/com/jetbrains/python/PyBundle.properties
python/src/com/jetbrains/python/formatter/PyImportsCodeStylePanel.form
python/src/com/jetbrains/python/formatter/PyImportsCodeStylePanel.java
python/testData/optimizeImports/joinFromImportsAndRelativeImports.after.py

index 1c97f3f02175f562f6eac0fdb5722c4589971e53..a33392b75cf610dc039cbd462865fe6e0c85580f 100644 (file)
@@ -971,6 +971,12 @@ windowWithActions.closeWindow=Close window
 # "Stop" button title
 windowWithActions.stopProcess=Stop currently running process
 
+formatter.imports.panel.title=Imports
+formatter.imports.panel.optimize.imports=Optimize Imports
+formatter.imports.panel.sort.alphabetically=Sort import statements alphabetically
+formatter.imports.panel.sort.names.in.from.imports=Sort names in "from ... import ..." imports
+formatter.imports.panel.join.from.imports.with.same.source=Join "from ... import ..." from the same source
+
 formatter.panel.dict.alignment.do.not.align=Do not align
 formatter.panel.dict.alignment.align.on.colon=Align on colon
 formatter.panel.dict.alignment.align.on.value=Align on value
index e4395d2e21cd83a8e46737a87a1eb0d8bbb16ea9..ca48ee06f690fe47652933167e5f12283e6d60bc 100644 (file)
         <clientProperties>
           <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
         </clientProperties>
-        <border type="none" title="Optimize Imports"/>
+        <border type="none" title-resource-bundle="com/jetbrains/python/PyBundle" title-key="formatter.imports.panel.optimize.imports"/>
         <children>
           <component id="e4d2f" class="com.intellij.ui.components.JBCheckBox" binding="mySortImportsAlphabetically" default-binding="true">
             <constraints>
               <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"/>
             </constraints>
             <properties>
-              <text value="Sort import statements alphabetically"/>
+              <text resource-bundle="com/jetbrains/python/PyBundle" key="formatter.imports.panel.sort.alphabetically"/>
             </properties>
           </component>
           <component id="fdf9d" class="com.intellij.ui.components.JBCheckBox" binding="mySortNamesInFromImports" default-binding="true">
@@ -37,7 +37,7 @@
               <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
             </constraints>
             <properties>
-              <text value="Sort names in &quot;from ... import ...&quot; imports"/>
+              <text resource-bundle="com/jetbrains/python/PyBundle" key="formatter.imports.panel.sort.names.in.from.imports"/>
             </properties>
           </component>
           <component id="a7a3a" class="com.intellij.ui.components.JBCheckBox" binding="myJoinFromImportsWithSameSource" default-binding="true">
@@ -45,7 +45,7 @@
               <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"/>
             </constraints>
             <properties>
-              <text value="Join &quot;from ... import ...&quot; from the same source"/>
+              <text resource-bundle="com/jetbrains/python/PyBundle" key="formatter.imports.panel.join.from.imports.with.same.source"/>
             </properties>
           </component>
         </children>
index 1c1173f8750f91c9ff8b8525bbe30600cbf05371..baac8ee6e4b9c0d2c697bccf860a01b81272ca14 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.fileTypes.FileType;
 import com.intellij.openapi.options.ConfigurationException;
 import com.intellij.psi.codeStyle.CodeStyleSettings;
 import com.intellij.ui.components.JBCheckBox;
+import com.jetbrains.python.PyBundle;
 import com.jetbrains.python.PythonFileType;
 import com.jetbrains.python.PythonLanguage;
 import org.jetbrains.annotations.NotNull;
@@ -47,7 +48,7 @@ public class PyImportsCodeStylePanel extends CodeStyleAbstractPanel {
 
   @Override
   protected String getTabTitle() {
-    return "Imports";
+    return PyBundle.message("formatter.imports.panel.title");
   }
 
   @NotNull
index 044b56da884bec98e4ef83471b45a476805f9863..1a7439689988183e9a0cbfc9d37085aa4140167b 100644 (file)
@@ -1,11 +1,7 @@
-from .module import b
-from ..module import a
-from ..module import c
-from .module import d
-from . import module1
-from . import module2
-from .. import pkg1
-from .. import pkg2
+from . import module1, module2
+from .module import b, d
+from .. import pkg1, pkg2
+from ..module import a, c
 
 print(a, b, c, d, module1, module2, pkg1, pkg2)