You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gp-maven-plugin/README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -450,6 +450,32 @@ If this parameter is not specified, `upload` goal creates a new Globalization Pi
450
450
with all available machine translation target languages, and `download` goal exports all
451
451
target languages currently available in the Globalization Pipeline bundle.
452
452
453
+
#### `<pathToBundleMapper>`
454
+
455
+
Specifies a mapping rule for converting source bundle file path to Globalization Pipeline bundle
456
+
ID. To specify a mapping rule, use one or more `<regexMapper>` elements with pattern and replacement.
457
+
A source resource file path relative to the base source directory (`<directory>` value in `<sourceFiles>` element) is used as the input of target path conversion specified by this setting.
458
+
For each `<regexMapper>` element, substring matching a Java regular expression pattern specified by
459
+
`<pattern>` value will be replaced with the value specified by `<replacement>` value.
460
+
461
+
The example below will remove `.properties` from a given path, then replace `/` with `.`.
462
+
For example, an input path `com/ibm/g11n/example/MyStrings.properties` will produce
463
+
a fully qualified Java class name `com.ibm.g11n.example.MyStrings`, which will be used as the
464
+
Globalization Pipeline bundle ID for the resource file.
465
+
466
+
```
467
+
<pathToBundleMapper>
468
+
<regexMapper>
469
+
<pattern>(.+).properties</pattern>
470
+
<replacement>$1</replacement>
471
+
</regexMapper>
472
+
<regexMapper>
473
+
<pattern>/</pattern>
474
+
<replacement>\.</replacement>
475
+
</regexMapper>
476
+
</pathToBundleMapper>
477
+
```
478
+
453
479
#### `<languageMap>`
454
480
455
481
Specifies custom language mappings. Each nested element name is a [BCP 47 language tag](https://tools.ietf.org/html/bcp47)
@@ -527,6 +553,31 @@ then the French version will be `com/ibm/g11n/fr/MyMessages.properties`.
527
553
528
554
The default value is **LANGUAGE_SUFFIX**.
529
555
556
+
*Note: This element is ignored when `<sourcePathToTargetMapper>` is specified.*
557
+
558
+
#### `<sourcePathToTargetMapper>`
559
+
560
+
Specifies mapping rule(s) to control output file path in `download` goal. To specify a mapping rule, use one or more `<regexMapper>` elements with pattern and replacement. A source resource file path
561
+
relative to the base source directory (`<directory>` value in `<sourceFiles>` element) is used as
562
+
the input of target path conversion specified by this setting. For each `<regexMapper>` element,
563
+
substring matching a Java regular expression pattern specified by `<pattern>` value will be replaced
564
+
with the value specified by `<replacement>` value. The final output path must contain a special
565
+
place holder token `%LANG%`, which will be replaced with a target language code.
566
+
567
+
The example below will replace a folder `en` with `%LANG%`. For example, when a source file path
568
+
is `nls/comp1/en/Help.json`, the path will be converted to `nls/comp1/%LANG%/Help.json`. Then,
569
+
`%LANG%` will be replaced with language ID (configured by `<languageIdStyle>` and `<languageMap>`).
0 commit comments