Skip to content

Commit

Permalink
removed references to Hop Translator. fixes #4271
Browse files Browse the repository at this point in the history
  • Loading branch information
bamaer committed Sep 28, 2024
1 parent dd55536 commit 1361851
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 234 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ This module obviously contains everything related to the Hop GUI

- Tools: *hop-gui, hop-translate*
- Hop GUI: *HopGui, HopDataOrchestrationPerspective, HopPipelineFileType, ...*
- Translator, a tool to help you translate Hop itself: *Translator*
- The rest is mostly a collection of re-usable dialogs and widgets

== Metadata
Expand Down
129 changes: 14 additions & 115 deletions docs/hop-dev-manual/modules/ROOT/pages/internationalisation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ under the License.
[[Internationalisation-Internationalisation]]
= Hop internationalisation

== Introduction
== Using Weblate

Hop is already being used in many countries across the world where different languages are spoken.
As such "internationalisation" represents the support for multiple languages in our software.
Since it is such a long word it is typically abbreviated to i18n.
=== Use Weblate as a Translation Tool

== Translating changes source code
Weblate official website: https://weblate.org

Weblate documentation: https://docs.weblate.org

Weblate source code: https://github.com/WeblateOrg/weblate

Apache Hop project translation address: https://translate.project-hop.org

You can go to the Apache Hop project translation page and participate in the translation work of the project. Thank you for your participation.


== Translating changes in the source code

The message bundles that contains the translations for the various parts of Hop are part of the source code.
If you want to start any i18n efforts we recommend that you set up your development environment first as described here:
Expand Down Expand Up @@ -121,113 +130,3 @@ HopGui.Menu.File=&File
....
-----

== Translator concerns

If you think that it's quite a bit of a pain to figure out the keys, locations, locale and so on: we agree!
To make i18n easy and translating fun we created a tool called Hop Translator.
Translator allows you to provide strings for the keys that you use in your source code.
It will create the message bundles in the right location, in the right format (in UTF-8) and with the right Apache license header.

*Please note*

*Warning: hop-translator.sh tool has been deleted. For specific information, please check this https://github.com/apache/hop/pull/4181[pr]*

To run translator simply build the code and then:

[source]
-----
cd assemblies/client/target/
unzip -q hop-*.zip
cd hop
sh hop-translator.sh translator.xml ../../../../
-----

In other words, run Translator and point it to the location of the source code you want to analyze.

=== Do not be too smart

Translator uses a simple Java code scanner to look for patterns like

* PKG
* BaseMessages.getString
* "i18:

So please give Translator a chance to pick up the i18n keys as well as the package in which they're being used.
If you think that it would be "better" to use things like clever prefixes and so on please remember that all you're doing is making sure your keys can't be found by Translator and as such are hard to translate.

As much as possible, define the PKG variable to the same class as the one you're working in.
This will prevent message bundles from becoming too large and perhaps difficult to merge later on.

== Using Translator

=== Use Weblate as a Translation Tool

Weblate official website: https://weblate.org

Weblate documentation: https://docs.weblate.org

Weblate source code: https://github.com/WeblateOrg/weblate

Apache Hop project translation address: https://translate.project-hop.org

You can go to the Apache Hop project translation page and participate in the translation work of the project. Thank you for your participation.

=== Please note

The following content is outdated

*Warning: hop-translator.sh tool has been deleted. For specific information, please check this https://github.com/apache/hop/pull/4181[pr]*

To use Translator you need 2 things: the Hop source code and a recent build of Hop.
With the latter you can start Translator like this:

[source]
----
sh hop-translator.sh translator.xml /path/to/hop/source/code
----

After a few seconds of code-scanning you'll see the following interface:

image::hop-translator-after-start.png[Hop Translator main window after start]

The default locale ```en_US``` will be selected by default.

=== Translating keys

As an example, here is how we can translate the Hop GUI menu to Dutch:

* Select the hopgui package: ```org.apache.hop.ui.hopgui````
* Select locale ```nl_NL``` at the very top left
* Select any of the missing ```HopGui.Menu...``` keys

In the following screenshot we selected ```HopGui.Menu.Edit.Cut```:

image::hop-translator-translating-a-key.png[Hop Translator main window after selecting a package and the nl_NL locale]

Now we can type in the translation for "Cut selected to clipboard" and hit the Apply button.
Finally, when we're done with all keys and packages we can use the "Save" button to make sure our efforts are not for nought:

image::hop-translator-save-files-dialog.png[Hop Translator: the save files dialog]

Once the files are saved you re-build Hop and test them by using the translated keys.
Finally, don't forget to commit and push changes as described here: xref:setup-dev-environment.adoc[Setting up your development environment]

Please reference a Github Issue and see if there aren't any already for the locale you're covering.

=== Highlighting codes

As you can see in the screenshot above many packages for nl_NL are highlighted.
That is because there are a lot of non-translated keys in those packages:

* light red: the message bundle is missing
* the darkest gray: over 50 keys are not translated
* dark gray: over 25 keys are not translated
* gray: over 10 keys are not translated
* light gray: over 5 keys are not translated
* the lightest gray: at least one key is not translated

=== Adding a new locale

If you want to translate a new locale, simply add it to the translator.xml file available in the root of your Hop build.


1 change: 0 additions & 1 deletion docs/hop-user-manual/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ under the License.
** xref:hop-tools/hop-search.adoc[hop-search]
** xref:hop-tools/hop-import.adoc[hop-import]
** xref:hop-server/index.adoc[hop-server]
** xref:hop-tools/hop-translator.adoc[hop-translator]
* xref:best-practices/index.adoc[Best Practices]
* xref:protips/index.adoc[Pro Tips]
* xref:hop-usps.adoc[Unique Selling Propositions]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,43 +427,3 @@ Linux, macOS::

Read more at xref:tech-manual::hop-vs-kettle/import-kettle-projects.adoc[Technical Manual -> Hop vs Kettle -> Import Kettle Projects]

== Hop Translator

include::../snippets/hop-tools/hop-translator.adoc[]

TIP: check the https://hop.apache.org/community/contribution-guides/translation-contribution-guide/[Translation Contribution Guide] if you want to find out more about translating Hop.

  +

The example below starts the Hop Translator tool with the provided `translator.xml` file. The second parameter is the path to your local version of the https://www.github.com/apache/hop[Apache Hop source code].

[tabs]
====
Windows::
+
--
[source,bash]
----
hop-translator.bat translator.xml <YOUR_PATH_TO_THE_HOP_CODE>
----
Expected output: the Hop Translator tool starts.
--
Linux, macOS::
+
--
[source,bash]
----
./hop-translator.sh translator.xml <YOUR_PATH_TO_THE_HOP_CODE>
----
Expected output: the Hop Translator tool starts.
--
====

https://hop.apache.org/community/contribution-guides/translation-contribution-guide/[Read more about contributing translations to Hop]

Read more about xref:../hop-tools/hop-translator.adoc[Hop Tools -> Hop Translator]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ This page provides an overview of the tools that are available in the platform.
* xref:hop-tools/hop-search.adoc[Hop Search]
* xref:hop-tools/hop-import.adoc[Hop Import]
* xref:hop-server/index.adoc[Hop Server]
* https://hop.apache.org/community/contribution-guides/translation-contribution-guide/[Hop Translator]
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ include::hop-search.adoc[]

Hop Server::
include::hop-server.adoc[]

Hop Translate::
include::hop-translator.adoc[]

This file was deleted.

0 comments on commit 1361851

Please sign in to comment.