Skip to content

How to tell tx where to download the files? #171

Description

@Sopor

In the old tx i used:
/usr/local/bin/tx --root /home/username/lang/convert pull -a and the files was downloaded in to a directory called en_examplexml full path /home/username/lang/convert/en_examplexml and it doesn't matter where i ran the tx command from.

In this new version i run tx --config /home/username/lang/convert/.tx/config pull -a, but this new version will create the directory en_examplexml in the same directory i run tx from and download the files in to en_examplexml.

I have tried to use --root-config, but it want a file and not a directory.

If i add the path to the config after --root-config file it tell me that i need to run tx init.

So, what is the difference between --root-config and --config?

It seems that i'm forced to run tx in the same directory as the .tx directory or what am i doing wrong?

Activity

  1. kbairak commented on Mar 28, 2023

    @kbairak

    So, what is the difference between --root-config and --config?

    The root configuration holds your API token for interacting with transifex while the local configuration holds your project's setup, ie which remote resources map to which local files (and what file format they use and potential language mappings etc). The reason for this distinction is that local configurations can be committed to your version control system and thus shared with other teammates while API tokens shouldn't.

    If you don't use the --root-config and/or --config flags, then the root configuration will be read from ~/.transifexrc (in Linux/MacOS systems) and the local configuration will be read from ./.tx/config. You can use these flags to override the paths.

    It seems that i'm forced to run tx in the same directory as the .tx directory or what am i doing wrong?

    It seems you are correct. We don't have a way to override the "working directory" of the application. So you will need to cd into your project's directory before running the command. We could look into bringing the --root flag back (although if we did I would propose renaming it to --pwd or --cwd or something like that) but we would have to measure its importance. For example, would not having this flag break your workflow? Are you aware of other similar tools that do have this option?

  2. Mi605 commented on Mar 28, 2023

    @Mi605

    So you will need to cd into your project's directory before running the command.

    As a workaround you can edit the ./.tx/config file manually. Just add the full absolute target path to the lines file_filter and source_file, then tx client will write and read it's output and input files from and to the desired directories, regardless from where it was called. (You'll have to create the needed subdirectories manually beforehand in this case, otherwise tx client hangs forever on execution.) If you don't want to modify your original config, just copy it to config-temp, modify the -temp copy of the config file and run tx with -c '/path/to/config-temp' option.

    We could look into bringing the --root flag back (although if we did I would propose renaming it to --pwd or --cwd or something like that) but we would have to measure its importance.

    If asked, I'd consider such a flag useful for temporary out of default workflow testing and checking translations without touching current state of default local copy by redirecting them to another directory. But as said, the same can be achieved by the described workaround as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions