Skip to content

-n, --name <string> optional ↡ | output filenameΒ #85

@ryders

Description

@ryders

I'm mucking around trying to understand the output filename option from the command line.

I've tried several different calls and each seem to make very little sense; At first I thought this is my understanding that is not correct so I would appreciate if anyone could enlighten me...

root@c76c41e1100c:/usr/src/app/src# jsontt ./assets/i18n/en.json -m google2 -f en -t sl -n ./assets/i18n/sl.json -fb no -cl 1
βœ” DONE! 719 of 719 translated.
 All files are created! You can find them in the same folder as the original file.
 Could not save the file.
 For Slovenian --> /./assets/i18n/sl.json.sl.json created.
 
root@c76c41e1100c:/usr/src/app/src# jsontt ./assets/i18n/en.json -m google2 -f en -t sl -n assets/i18n/ -fb no -cl 1
βœ” DONE! 719 of 719 translated.
 All files are created! You can find them in the same folder as the original file.
 Could not save the file.
 For Slovenian --> /assets/i18n/.sl.json created.
 
root@c76c41e1100c:/usr/src/app/src# jsontt assets/i18n/en.json -m google2 -f en -t sl -n assets/i18n/ -fb no -cl 1
βœ” DONE! 719 of 719 translated.
 All files are created! You can find them in the same folder as the original file.
 Could not save the file.
 For Slovenian --> /assets/i18n/.sl.json created.
 
root@c76c41e1100c:/usr/src/app/src# jsontt assets/i18n/en.json -m google2 -f en -t sl -n sl.json -fb no -cl 1
βœ” DONE! 719 of 719 translated.
 All files are created! You can find them in the same folder as the original file.
 For Slovenian --> /sl.json.sl.json created.

Screenshot 2024-12-06 at 01 03 47

-n value actual result notes
a full path and filename; -n ./assets/i18n/sl.json a slash (/) is prepended, and a weird .filename.ext is appended to form; /./assets/i18n/sl.json.sl.json Could not save the file.
relative folder only; -n assets/i18n/ / is prepended and so is the . in front of the filename... /assets/i18n/.sl.json Could not save the file.
just the filename; -n sl.json same / prefix and .sl.json suffix; /sl.json.sl.json file written in the correct folder, unlike what is suggested by output, but with a bad name

I don't understand why... this seems weird;

  1. the file should be written in the current folder, or in the location specified
  2. the filename should NOT (ever!) be prefixed with . yet this seems consistent in all my tests

So as per the documentation I proceeded to try jsontt your/path/to/file.json, answer a few questions, and sure enough, the output file is created in the same folder as the source, and with the correct name. And sure enough, using any permutation of the -n <filename> as per man and --help just - doesn't - work!!

Suggestions & Questions;

  1. you really ought to rename this -n flag to -p... this is not a "filename" option, this is a file "prefix" option. 🀯🀯 with all due respect to the work done so far... the documentation cannot read 'filename'!
  2. so my remaining question then; How do I suppress all user interaction if I cannot supply the filename? 😡😡

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions