Skip to content

Commit

Permalink
PDI-12869 : Translator2 does not handle the new source code format very
Browse files Browse the repository at this point in the history
well
  • Loading branch information
mattcasters committed Sep 9, 2014
1 parent a5a3e26 commit 2c819fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 2 additions & 6 deletions translator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<root>engine/src</root>
<root>ui/src</root>

<!--- <root>dbdialog/src</root>
<root>jdbc/src</root> -->

<root>plugins/kettle-gpload-plugin/src</root>
<root>plugins/star-modeler/src</root>
<root>plugins/market/src</root>
Expand All @@ -23,8 +20,7 @@
</source-directories>

<scan-phrases>
<scan-phrase>Messages.getString(</scan-phrase>
<scan-phrase>BaseMessages.getString(PKG,</scan-phrase>
<scan-phrase>BaseMessages.getString( PKG,</scan-phrase>
</scan-phrases>

<locale-list>
Expand Down Expand Up @@ -64,6 +60,7 @@
<filename>DataHandler.java</filename>
<filename>FragmentHandler.java</filename>
<filename>Launch.java</filename>
<filename>HelpUtils.java</filename>

</files-to-avoid>

Expand Down Expand Up @@ -97,4 +94,3 @@
</xml-folders-to-scan>

</translator-config>

4 changes: 2 additions & 2 deletions ui/src/org/pentaho/di/ui/i18n/MessagesSourceCrawler.java
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ public void lookForOccurrencesInFile( String sourceFolder, FileObject javaFile )
boolean extraLine;
do {
extraLine = false;
for ( String scanPhrase : scanPhrases ) {
if ( line2.endsWith( scanPhrase ) ) {
for ( String joinPhrase : new String[] { "BaseMessages.getString(", "BaseMessages.getString( PKG," } ) {
if ( line2.endsWith( joinPhrase ) ) {
extraLine = true;
break;
}
Expand Down
10 changes: 4 additions & 6 deletions ui/src/org/pentaho/di/ui/i18n/editor/Translator2.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public void open() {
addGrid();
addListeners();

sashform.setWeights( new int[] { 20, 80 } );
sashform.setWeights( new int[] { 40, 60 } );
sashform.setVisible( true );

shell.pack();
Expand Down Expand Up @@ -486,7 +486,7 @@ private void addLists() {
fdLocale.left = new FormAttachment( 0, 0 );
fdLocale.right = new FormAttachment( 100, 0 );
fdLocale.top = new FormAttachment( 0, 0 );
fdLocale.bottom = new FormAttachment( 20, 0 );
fdLocale.bottom = new FormAttachment( 10, 0 );
wLocale.setLayoutData( fdLocale );

ColumnInfo[] colinfo =
Expand All @@ -496,10 +496,7 @@ private void addLists() {
new ColumnInfo(
BaseMessages.getString( PKG, "i18nDialog.Packagename" ), ColumnInfo.COLUMN_TYPE_TEXT, false, true ), };

wPackages =
new TableView(
new Variables(), composite, SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER, colinfo, 1, true, null,
props );
wPackages = new TableView( new Variables(), composite, SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER, colinfo, 1, true, null, props );
FormData fdPackages = new FormData();
fdPackages.left = new FormAttachment( 0, 0 );
fdPackages.right = new FormAttachment( 100, 0 );
Expand Down Expand Up @@ -1122,6 +1119,7 @@ public void refreshPackages() {
} else {
wPackages.setRowNums();
wPackages.optWidth( true );
wPackages.getTable().getColumn( 1 ).setWidth( 100 );
}
}

Expand Down

0 comments on commit 2c819fa

Please sign in to comment.