Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
Added source folders and destination languages to console help command
  • Loading branch information
cannycookie committed Jul 10, 2023
1 parent a66c987 commit 2506089
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 202 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
- Handles both PHP and JSON files
- Model translations coming soon

## Requirements

PHP 8.1 Is the minimum for the OpenAI Wrapper.

Tested with Laravel ^9.45 and 10.x

Filament is not required (but can add to their already awesome set of translations.)


## Installation

Download the package via composer:
Expand Down Expand Up @@ -46,6 +55,8 @@ Currently handles `.json` and `.php` translation files.
Attribute tokens should remain unchanged. This was a challenge as GPT-3.5 refused to ignore :attribute and always translated it even when told explicity to ignore it.
To solve this all tokens are replaced with *** before translation and added back in after translation ensuring continuity.

![php artisan vb:ai:translate --help](./media/help.png)

To run the script:-

```bash
Expand All @@ -56,6 +67,8 @@ The script will scan all the source_directories for translation files and then p

If you're happy to continue, select the model you wish to use and each source file will be translated.

![php artisan vb:ai:translate](./media/screenshot.png)

If the target file exists, only new keys not in the target will be translated. Unless you use the --force option which will overwrite any existing translations.


Expand Down
1 change: 1 addition & 0 deletions config/ai-translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//But do not include it here. These are the parent directories.
'source_directories' => [
'lang',
'resources/lang',
//Developers can point to their packages to have them translated
//Either in vendor or where ever they happen to be
'vendor/visualbuilder/email-templates/resources/lang',
Expand Down
Binary file added media/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2506089

Please sign in to comment.