Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Documentation
Bug Fixes
---------

- Fixed errors in the ``~/.transifexrc`` file generated by the ``create-transifexrc`` command;
the correct value for ``rest_hostname`` is ``https://rest.api.transifex.com``.
Note: ``create-transifexrc`` command and ``SPHINXINTL_TRANSIFEX_TOKEN`` have been deprecated.
They will be removed after six months. Please use the TX_TOKEN environment variable instead.

2.1.0 (2023/02/05)
==================

Expand Down
13 changes: 11 additions & 2 deletions sphinx_intl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"""
import re
import os
import warnings
from glob import glob

import click
Expand Down Expand Up @@ -134,7 +135,7 @@ def convert(self, value, param, ctx):
'--transifex-token',
envvar=ENVVAR_PREFIX + '_TRANSIFEX_TOKEN',
type=str, metavar='<TOKEN>', required=True,
help="Your transifex token.")
help="Your transifex token. (DEPRECATED)")

option_transifex_organization_name = click.option(
'--transifex-organization-name',
Expand Down Expand Up @@ -300,8 +301,16 @@ def stat(locale_dir, language):
@option_transifex_token
def create_transifexrc(transifex_token):
"""
Create `$HOME/.transifexrc`
Create `$HOME/.transifexrc` (deprecated)
"""
warnings.filterwarnings("default", category=DeprecationWarning)
warnings.warn(
(
"create-transifexrc command and SPHINXINTL_TRANSIFEX_TOKEN "
"will be deprecated. Please use TX_TOKEN environment variable instead."
),
category=DeprecationWarning,
)
transifex.create_transifexrc(transifex_token)


Expand Down
2 changes: 1 addition & 1 deletion sphinx_intl/transifex.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

TRANSIFEXRC_TEMPLATE = """\
[https://www.transifex.com]
rest_hostname = https://www.transifex.com
rest_hostname = https://rest.api.transifex.com
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

token = %(transifex_token)s
"""

Expand Down