Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenestrosaDev committed May 3, 2023
2 parents adcabc7 + 0dd9675 commit 04cbb1a
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 25 deletions.
135 changes: 113 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,113 @@ The file types supported by the package are the following:

### Project Structure

#### Root directories:

- `.github/workflows`: GitHub workflows. It also includes the templates for issues and pull requests, as well as the `depandabot.yml` file for Dependabot configuration.
- `docs`: Contains files related to the documentation of the project.
- `src/mobile_strings_converter`: Contains the source code files.
- `tests`: Contains unit tests to ensure the correct functionality of the package. It also includes the `files` directory, which contains a few demo files in different formats to use in the unit tests.

#### Root files:

- `.gitignore`: File used by the version control system Git to specify files or directories that should be ignored by Git when tracking changes to a project.
- `.pre-commit-config.yaml`: Configuration file used by **pre-commit**, a tool that runs checks (such as linting, testing, or formatting) on the code before you commit changes to version control. The file specifies which checks pre-commit should run and how it should run them.
- `LICENSE`: Project license, which is [MIT](https://opensource.org/license/mit/).
- `poetry.lock`: File generated by **Poetry**, a package manager for Python, that contains the exact versions of all packages used by a project. The file is used to ensure that all members of a development team are using the same versions of packages, even if different versions are available in the package repository.
- `pyproject.toml`: Configuration file used by **Poetry**. It specifies the metadata for a Python project, including the project name, version, description, author, license and dependencies.
- `README.md`: What you are reading right now.
- `requirements.txt`: Lists the names and versions of each package used to build this project. To install the requirements, execute `pip install -r requirements.txt`.
- `requirements-dev.txt`: Lists the names and versions of each package used in the development stage of this project. To install the requirements, execute `pip install -r requirements-dev.txt`.
<details>
<summary>ASCII folder structure</summary>

```
│ .gitignore
│ .pre-commit-config.yaml
│ LICENSE
│ poetry.lock
│ pyproject.toml
│ README.md
│ requirements.txt
│ requirements-dev.txt
├───.github
│ │ CONTRIBUTING.md
│ │
│ ├───ISSUE_TEMPLATE
│ │ bug_report_template.md
│ │ feature_request_template.md
│ │
│ └───PULL_REQUEST_TEMPLATE
│ pull_request_template.md
├───docs
│ icon.png
├───src
│ ├───mobile_strings_converter
│ │ console_style.py
│ │ converter.py
│ │ __init__.py
│ │ __main__.py
│ │
│ ├───assets
│ │ └───fonts
│ │ Aakar.ttf
│ │ AnekTelugu-VariableFont_wdth,wght.ttf
│ │ DejaVuSansCondensed.ttf
│ │ Eunjin.ttf
│ │ fireflysung.ttf
│ │ gargi.ttf
│ │ Gurvetica_a8_Heavy.ttf
│ │ Latha.ttf
│ │ Waree.ttf
│ │
│ ├───controller
│ │ main_controller.py
│ │ __init__.py
│ │
│ ├───model
│ │ transcription.py
│ │ __init__.py
│ │
│ ├───utils
│ │ constants.py
│ │ i18n.py
│ │ path_helper.py
│ │ __init__.py
│ │
│ └───view
│ main_window.py
│ __init__.py
└───tests
│ base_tests.py
│ test_get_strings.py
│ test_to_android.py
│ test_to_csv.py
│ test_to_html.py
│ test_to_ios.py
│ test_to_json.py
│ test_to_md.py
│ test_to_ods.py
│ test_to_pdf.py
│ test_to_xlsx.py
│ test_to_yaml.py
└───files
├───input
│ Localizable.strings
│ strings.xml
├───template-with-comments
│ Localizable.strings
│ strings.csv
│ strings.html
│ strings.json
│ strings.md
│ strings.ods
│ strings.pdf
│ strings.xlsx
│ strings.xml
│ strings.yaml
└───template-without-comments
Localizable.strings
strings.csv
strings.html
strings.json
strings.md
strings.ods
strings.pdf
strings.xlsx
strings.xml
strings.yaml
```
</details>

<!-- BUILT WITH -->

Expand Down Expand Up @@ -240,11 +329,13 @@ to_google_sheets(

### Script flags

- The option `-h` or `--help` displays the help documentation.
- The option `-o` or `--output-filepath` specifies the filepath for storing the converted file. The file extension can be chosen from the list of supported file types mentioned [here](#about-the-project).
- The option `-g` or `--google-sheets` followed by the name of the sheet as `<SHEET NAME>` creates a new Google Sheets spreadsheet with the specified name.
- The option `-c` or `--credentials` followed by the path to your `service_account.json` file is mandatory if you want to generate a spreadsheet in your Google account.
- By using the `-p` or `--print-comments` option, the output file will include any commented strings present in the original file.
| Flag | Description |
|:----------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `-h` or `--help` | Displays help text for the program |
| `-o` or `--output-filepath` | Specifies the filepath for storing the converted file. The file extension can be chosen from the list of supported file types mentioned [here](#about-the-project). |
| `-g` or `--google-sheets` | Followed by the name of the sheet, creates a new Google Sheets spreadsheet with the specified name. |
| `-c` or `--credentials` | Followed by the path to your `service_account.json` file is mandatory if you want to generate a spreadsheet in your Google account. |
| `-p` or `--print-comments` | The output file will include any commented strings present in the original file. |

<p align="right">(<a href="#top">back to top</a>)</p>

Expand Down
2 changes: 1 addition & 1 deletion src/mobile_strings_converter/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def main():
should_print_comments=args.print_comments,
)

convert_strings(input_filepath, Path(args.output_path), args.print_comments)
convert_strings(input_filepath, Path(args.output_filepath), args.print_comments)


if __name__ == "__main__":
Expand Down
3 changes: 1 addition & 2 deletions src/mobile_strings_converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
import yaml
from arabic_reshaper import reshape
from bidi.algorithm import get_display
from console_style import ConsoleStyle
from fpdf import FPDF
from google.oauth2.credentials import Credentials
from lingua import LanguageDetectorBuilder

from .console_style import ConsoleStyle


def convert_strings(
input_filepath: Path, output_filepath: Path, should_print_comments: bool
Expand Down

0 comments on commit 04cbb1a

Please sign in to comment.