kongulov / nova-tab-translatable

This package contains a NovaTabTranslatable class you can use to make any Nova field type translatable with tabs.
MIT License
79 stars 17 forks source link

Translate File Field #10

Closed kickdev closed 1 year ago

kickdev commented 3 years ago

A similar issue with this https://github.com/spatie/nova-translatable/issues/18 /trix-attachment/translations_content_en Uncaught (in promise) ReferenceError: __ is not defined /trix-attachment/translations_content_en/9060d4cb-7b15-48d8-9a2f-32b9b5f7a06c 404 (Not Found) The story is the same with other types of editors.

kickdev commented 3 years ago

any news?

kongulov commented 3 years ago

@kickdev I tried to find a solution for him, but it didn't work. Since the trix filesystem keeps its files in a different field, this causes a problem. Compatibility with the trix file system will not work.

kickdev commented 3 years ago

I've been thinking a little, why shouldn't the package itself interfere with the work of the Trix/Froala system. Froala itself inherits all the basic elements from Trix. What is the idea to create your own element that inherits from Trix and override the function that is responsible for the fields, i.e. fillAttribute. Thus, after collecting the fields, we will get a working nesting system. in the request, we send data of the form translations_ as it wants to see only the original field. For attachments, they want to see the original attribute, but we pass them a fake type of translations. The way out is most likely this, when filling in the fields, already catch the attributes of the form translations and change. Either the second solution is to train the fields to understand json, then it will not give information about the fields not being found. findFieldByAttribute is used for fields

kongulov commented 2 years ago

@kickdev https://github.com/kongulov/nova-tab-translatable/issues/14#issuecomment-951816480

Update and see does this solves your problem? I wrote the code to make it work with the native file.

If this does not help, then I will rewrite it to support trix

kickdev commented 2 years ago

@kongulov

Update and see does this solves your problem? I wrote the code to make it work with the native file.

Unfortunately, it didn’t help. But I'm using froala, which inherits the interface from Trix.