Skip to content

Commit

Permalink
Starting internationalization
Browse files Browse the repository at this point in the history
  • Loading branch information
javatlacati committed Jan 8, 2016
1 parent f3af41c commit 217702a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 24 deletions.
10 changes: 8 additions & 2 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processor.options=
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=JSongBookIndexMaker
application.vendor=Administrador
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
Expand All @@ -24,13 +25,17 @@ debug.test.classpath=\
dist.dir=dist
dist.jar=${dist.dir}/JSongBookIndexMaker.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.org-openide-util.jar=C:\\Users\\Administrador\\Documents\\librerias Java\\org-openide-util.jar
includes=**
jar.compress=false
javac.classpath=
javac.classpath=\
${file.reference.org-openide-util.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=false
javac.processorpath=\
${javac.classpath}
javac.source=1.7
Expand All @@ -56,6 +61,7 @@ manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
project.license=gpl20
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
Expand Down
43 changes: 21 additions & 22 deletions src/tex/latex/gchords/JIndexMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,34 @@

/**
*
* @author Administrador
* @author Javatlacati
*/
public class JIndexMaker {

public static void main(String[] args) {
System.out.println("Welcome to JIndexMaker this app was designed to work with the Songbook latex package");
System.out.println("Usage: Select the file on the GUI, and this app will process it automatically according to the file extension");
JFileChooser chooser = new JFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter(
"Index Preprocessed files", "aIdx", "tIdx", "kIdx");
public static void main(final String[] args) {
System.out.println(org.openide.util.NbBundle.getBundle(JIndexMaker.class).getString("WELCOME"));
System.out.println(org.openide.util.NbBundle.getBundle(JIndexMaker.class).getString("USAGE"));
final JFileChooser chooser = new JFileChooser();
final FileNameExtensionFilter filter = new FileNameExtensionFilter(
org.openide.util.NbBundle.getBundle(JIndexMaker.class).getString("INDEXPREPROCESSEDFILES"), "aIdx", "tIdx", "kIdx"); //NOI18N
chooser.setFileFilter(filter);
int returnVal = chooser.showOpenDialog(null);
final int returnVal = chooser.showOpenDialog(null);
if (returnVal == JFileChooser.APPROVE_OPTION) {

String filename = chooser.getSelectedFile().getName();
int extensionIndex = filename.lastIndexOf(".");
String filenamewoextension = filename.substring(0, extensionIndex );
System.out.println("You chose to open this file: "
final String filename = chooser.getSelectedFile().getName();
final int extensionIndex = filename.lastIndexOf("."); //NOI18N
String filenamewoextension = filename.substring(0, extensionIndex);
System.out.println(org.openide.util.NbBundle.getBundle(JIndexMaker.class).getString("YOUCHOSE")
+ filename);
String extension = filename.substring(extensionIndex+1);
String extension = filename.substring(extensionIndex + 1);
System.out.println("The file has extension:" + extension);
System.out.println("Su archivo se llama:"+filenamewoextension);
System.out.println("Su archivo se llama:" + filenamewoextension);
String comando = "";
switch (extension) {
case "aIdx":
try {
System.out.println("Processing author index preprocessed file");
comando="makeindex -s songbook.ist -o " + filenamewoextension + ".adx " + filename;
System.out.println("Ejecutando:"+comando);
comando = "makeindex -s songbook.ist -o " + filenamewoextension + ".adx " + filename;
System.out.println("Ejecutando:" + comando);
Runtime.getRuntime().exec(comando);
} catch (IOException ex) {
System.err.println("Erro executing due to " + ex.getMessage());
Expand All @@ -47,18 +46,18 @@ public static void main(String[] args) {
case "tIdx":
try {
System.out.println("Processing title index preprocessed file");
comando="makeindex -s songbook.ist -o " + filenamewoextension + ".tdx " + filename;
System.out.println("Ejecutando:"+comando);
comando = "makeindex -s songbook.ist -o " + filenamewoextension + ".tdx " + filename;
System.out.println("Ejecutando:" + comando);
Runtime.getRuntime().exec(comando);
} catch (IOException ex) {
System.err.println("Erro executing due to " + ex.getMessage());
}
break;
case "kIdx":
case "kIdx":
try {
System.out.println("Processing key index preprocessed file");
comando="makeindex -s songbook.ist -o " + filenamewoextension + ".kdx " + filename;
System.out.println("Ejecutando:"+comando);
comando = "makeindex -s songbook.ist -o " + filenamewoextension + ".kdx " + filename;
System.out.println("Ejecutando:" + comando);
Runtime.getRuntime().exec(comando);
} catch (IOException ex) {
System.err.println("Erro executing due to " + ex.getMessage());
Expand Down
20 changes: 20 additions & 0 deletions src/tex/latex/gchords/JIndexMaker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2016 Ruslan L\u00f3pez Carro
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

WELCOME=Welcome to JIndexMaker this app was designed to work with the Songbook latex package
USAGE=Usage: Select the file on the GUI, and this app will process it automatically according to the file extension
INDEXPREPROCESSEDFILES=Index Preprocessed files
YOUCHOSE=You chose to open this file:

0 comments on commit 217702a

Please sign in to comment.