Skip to content

Commit

Permalink
[TASK] Respect max. line length in README
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrodala committed Mar 25, 2024
1 parent 9eac53e commit c5bf424
Showing 1 changed file with 36 additions and 14 deletions.
50 changes: 36 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ This extension serves as a working prototype for translatable files in TYPO3.

## Features

- Upload language variants using the File list module to provide variants transparently throughout the system.
- Replace or remove variants (which resets to the file of the default language).
- Metadata records are can be translated just like before, but no longer point to the same file record.
- File records are translatable, but not directly accessible. All editing is done through metadata records.
- Upload language variants using the File list module to provide variants
transparently throughout the system.
- Replace or remove variants (which resets to the file of the default
language).
- Metadata records are can be translated just like before, but no longer point
to the same file record.
- File records are translatable, but not directly accessible. All editing is
done through metadata records.

## Limits

Expand All @@ -18,8 +22,9 @@ This extension serves as a working prototype for translatable files in TYPO3.

1. Install extension via Composer: `composer require t3g/file-variants`
2. Activate the extension
3. (optional) Use the extension configuration to create a dedicated file storage. If you use no dedicated storage,
a dedicated folder will be used in default storage.
3. (optional) Use the extension configuration to create a dedicated file
storage. If you use no dedicated storage, a dedicated folder will be used in
default storage.

### Data Examples

Expand Down Expand Up @@ -66,7 +71,8 @@ local is sys_file, foreign is tt_content
| 3 | 2 | 1 | 3 | 3 |
| 4 | 3 | 1 | 1 | 4 |

Schematically the following relations exist and are created/maintained automatically:
Schematically the following relations exist and are created/maintained
automatically:

1. `tt_content:1` (English) -> `sys_file_reference:1` -> `sys_file:1` (English)
2. `tt_content:2` (German) -> `sys_file_reference:2` -> `sys_file:2` (German)
Expand All @@ -75,20 +81,36 @@ Schematically the following relations exist and are created/maintained automatic

## Behaviour

After Installation, the file metadata (`sys_file_metadata`) edit mask in File list module is slightly changed. Nothing changes for the default language. But creating / editing a file metadata translation allows for uploading a new file for this translation. The upload works the same way as the File list module and can be found next to the file info. This file will reside in the dedicated translation storage or folder. After uploading, the fileinfo element changes its content and displays the uploaded file.
After Installation, the file metadata (`sys_file_metadata`) edit mask in File
list module is slightly changed. Nothing changes for the default language. But
creating / editing a file metadata translation allows for uploading a new file
for this translation. The upload works the same way as the File list module and
can be found next to the file info. This file will reside in the dedicated
translation storage or folder. After uploading, the fileinfo element changes
its content and displays the uploaded file.

A button then allows for resetting to the file used in default language. **The file formerly used here is removed permanently!** Also, the upload control is displayed again, so the a new file can be uploaded at any time.
A button then allows for resetting to the file used in default language.
**The file formerly used here is removed permanently!**
Also, the upload control is displayed again, so the a new file can be uploaded
at any time.

During this process, all file references (`sys_file_reference`) are searched for a link to the default file, and updated with the translated one.
During this process, all file references (`sys_file_reference`) are searched
for a link to the default file, and updated with the translated one.

On each translation action to any record that contains a FAL field (like files or images), a check is performed to find out whether a file variant for the target language is available. If it is, the resulting file reference will link to that file variant instead of the default file.
On each translation action to any record that contains a FAL field (like files
or images), a check is performed to find out whether a file variant for the
target language is available. If it is, the resulting file reference will link
to that file variant instead of the default file.

This results in a consistent behaviour, that summarizes as:

- If a variant is available for a specific language, it will be used, everywhere and everytime.
- If no variant is available for a specific language, the default file is used (current standard TYPO3 behaviour).
- If a variant is available for a specific language, it will be used,
everywhere and everytime.
- If no variant is available for a specific language, the default file is used
(current standard TYPO3 behaviour).

## Missing Features

1. Upgrade wizard: if file metadata translations already exist, no file variants are provided or added.
1. Upgrade wizard: if file metadata translations already exist, no file
variants are provided or added.
2. Workspaces support.

0 comments on commit c5bf424

Please sign in to comment.