@drone1/alt 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -100,10 +100,12 @@ Sample output:
100
100
  Note that output files can be lower-cased if you pass the ``--normalize-output-filenames`` option, so `fr-FR` translations would write to `fr-fr.json`
101
101
 
102
102
  ## Config file
103
- [_optional_] You can create a config file. By default, `ALT` will search the output directory for `config.json`, but you can specify a path directly using
103
+ [_optional_] For convenience, a config file is supported. You can use a config file in conjunction with command-line arguments. Command-line arguments override config file values.
104
+
105
+ By default, ALT will search the output directory for `config.json`, but you can specify a path explicitly using
104
106
  `--config-file`.
105
- Example
106
- config:
107
+
108
+ Here's an example config:
107
109
 
108
110
  ```
109
111
  {
@@ -123,12 +125,14 @@ Any of the above settings can be specified using command-line arguments (`--app-
123
125
 
124
126
  ## Adding context
125
127
  Sometimes a string isn't enough to give context to the AI, and as a result, it may give an undesirable translation. ALT allows you to specify additional context for this reason.
128
+
126
129
  ### Application-level context
127
130
  A global, application description can be specified `--app-context-message` (or `appContextMessage` in a [config](#config)).
128
131
  For example, your config may include something like:
129
132
  ```json
130
133
  "appContextMessage": "Voided is a MMORPG game based on outer space."
131
134
  ```
135
+
132
136
  ### String-specific context
133
137
  Context can be added for any reference key/value pairs by passing `--look-for-context-data` (or setting `lookForContextData: true` in a [config](#config)).
134
138
 
@@ -281,20 +285,27 @@ Internally, there is currently nothing in the prompt about this. I've tested wit
281
285
  Please submit an issue if it causes you any trouble.
282
286
 
283
287
  ## Translation rules
284
- When does ALT translate a given source string? Translation will occur for a given target language & reference key/value if any of the following are true:
288
+ Under what conditions will ALT translate a given source string?
289
+
290
+ Translation will occur for a given target language & reference key/value if any of the following are true:
291
+
285
292
  * The output file does not exist
293
+ * Example: You're translating to target language _zh-Hans_ and `zh-Hans.json` doesn't exist
286
294
  * The output file is missing the reference key
295
+ * Example: You're translating reference key _error-msg_ to target language _zh-Hant.jso_ and `zh-Hans.json` does not have a key/value pair for key _error-msg_
287
296
  * The reference value was modified
288
- * A context value for the given target language/key is found and has been modified.
297
+ * Example: You change the value of _some-key_ in your reference file
298
+ * A context value for the given target language/key is found and has been modified
299
+ * Example: You modify the value of _context:error-msg_ in your reference file. _error-msg_ will be re-translated for all target languages.
289
300
  * `-f` or `--force` are specified
290
301
  * The cache file (`.localization.cache.json`) is not present
291
302
 
292
- Translation will _not_ occur if `alt` detects that the given value in the target language file has been manually modified. If you modify an output value manually and want it to be re-translated
303
+ NOTE: Translation will _not_ occur if ALT detects that the given value in the target language file has been manually modified. If you modify an output value manually and want it to be re-translated
293
304
  later, you can just delete that key/value pair from the given file.
294
305
 
295
306
  ## Additional notes
296
307
  ### Delayed vs. realtime writes
297
- By default, `alt` will not write to disk until the tool is shutting down (including SIGTERM – yes, `Ctrl+C` is safe).
308
+ By default, ALT will not write to disk until the tool is shutting down (including SIGTERM – yes, `Ctrl+C` is safe).
298
309
 
299
310
  This behavior is useful if your application is monitoring the output directory and you don't want your server
300
311
  constantly restarting, for example.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@drone1/alt",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "description": "An AI-powered localization tool",
6
6
  "main": "src/index.mjs",
7
7
  "bin": {