christophekonig
Forum Replies Created
-
The problem is that translated terms are not loading in the correct order when form is displayed outside of admin.
I’ve found a really poor way to fix this.
In you functions.php, paste this :
add_action('acf/enqueue_scripts', 'af_translation_fix', 10, 0); function af_translation_fix() { if(!is_admin()) { acf_localize_text(array( // unload 'The changes you made will be lost if you navigate away from this page' => __('The changes you made will be lost if you navigate away from this page', 'acf'), // media 'Select.verb' => _x('Select', 'verb', 'acf'), 'Edit.verb' => _x('Edit', 'verb', 'acf'), 'Update.verb' => _x('Update', 'verb', 'acf'), 'Uploaded to this post' => __('Uploaded to this post', 'acf'), 'Expand Details' => __('Expand Details', 'acf'), 'Collapse Details' => __('Collapse Details', 'acf'), 'Restricted' => __('Restricted', 'acf'), 'All images' => __('All images', 'acf'), // validation 'Validation successful' => __('Validation successful', 'acf'), 'Validation failed' => __('Validation failed', 'acf'), '1 field requires attention' => __('1 field requires attention', 'acf'), '%d fields require attention' => __('%d fields require attention', 'acf'), // tooltip 'Are you sure?' => __('Are you sure?','acf'), 'Yes' => __('Yes','acf'), 'No' => __('No','acf'), 'Remove' => __('Remove','acf'), 'Cancel' => __('Cancel','acf'), // conditions 'Has any value' => __('Has any value', 'acf'), 'Has no value' => __('Has no value', 'acf'), 'Value is equal to' => __('Value is equal to', 'acf'), 'Value is not equal to' => __('Value is not equal to', 'acf'), 'Value matches pattern' => __('Value matches pattern', 'acf'), 'Value contains' => __('Value contains', 'acf'), 'Value is greater than' => __('Value is greater than', 'acf'), 'Value is less than' => __('Value is less than', 'acf'), 'Selection is greater than' => __('Selection is greater than', 'acf'), 'Selection is less than' => __('Selection is less than', 'acf'), // misc 'Edit field group' => __('Edit field group', 'acf'), )); } }
I have the exact same problem and am searching for a solution…
Hello,
I’ve got some problems myself with wp-offload-media and WPML even though they say it is compatible.
I had a discussion with their developers, pointed some issues, and they managed to fix some bugs not long ago about this.
But here is what I know :
If you decide to not translate medias (and to not duplicate them when your insert a post), the media won’t be available in the translated language so first thing is you MUST duplicate medias to other language so they can be available in the translated language.
Then, if everything is fine, a “duplicate” will be created in the database. There won’t be 2 physical files but 2 attachment posts linking to the same file and, in the metadata of the duplicated attachment, there will be the ID of the original language attachement.
With this this meta information, wp-offload-media is able to recover the main language attachment and get its URL.
The very bad point about that is : If you have, let’s say, 5 languages on your site, wp-offload-media will count 5 activations down on your licence for each attachment, even though there is only one physical file moved to S3… I complained a little about that but they consider that is normal. So my very expensive license has already reached the limit because of this.
I’ve tried “Media cloud” and it is really an amazing plugin. Sadly, there is absolutely no WPML integration. I’ve actually started looking for writing it myself.
Some simple filters would do. I think it could fit in about 30-40 lines of code.
To the developer, don’t hesitate to contact me if I can help you build this integration or provide you with a WPML activation key ! That would be really awesome to make Media Cloud fully compatible with WPML.
Wow, it’s working great now !
And I’ve managed to move the file on S3 and update metadata whenever the file is moved inside another RML folder.
So, all is good, thank a lot for your help and for this great plugin.
Mmm I already tried hooking into “upload_dir” but that didn’t do the job and in the debug log i have something like this :
11/30/2018 7:28 pm ilab-media-tool INFO Finished uploading whatever/you/like/here//birthday-2.jpg to S3.
11/30/2018 7:28 pm ilab-media-tool INFO End Upload file = 2018/11/birthday-2.jpg, time = 0.279597997665
11/30/2018 7:28 pm ilab-media-tool INFO Start Upload file = 2018/11/birthday-2.jpg
11/30/2018 7:28 pm ilab-media-tool INFO Uploading whatever/you/like/here//birthday-2.jpg to S3.The code you provided also give the same result.
Yes you are right, it is just tagging, it doesn’t alter the files path physically but I need to reproduce the folder structure on S3 though.
That’s because editors will then browse into the S3 bucket, from other sites to search for photos so files have to be separated in folders for simpler search.
The only problem with this is if the file is “moved” (not phisically) to another RML folder, the file will have to be moved on S3 too and I guess this is not something your plugin is supposed to do, I was planning on developing that part myself.