-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make Profile entities translatable #25
Comments
@bugfolder I've done substantial work toward providing translation functionality for profile type labels. The PR I just submitted does the following:
This PR does not provide a full profile translation - it's only the profile type label. In that regard it does exactly what the Profile2 D7 module does. When you combine this new capability with Field translation, you can also get translated profile Field API field labels. Adding a full profile entity translation is a very different and very substantial endeavor, and it's been put on hold in D7. We can try that on a separate issue in the future perhaps. Can you please test? This new module depends on i18n_string There is one issue I've seen that I need to investigate - perhaps you can help me debug: when |
BTW to test, be sure to add a second language. Otherwise the translations won't do anything. |
This is my first foray into i18n, so I'll be muddling along for a bit. But regarding the fatal error, the exception
is getting thrown on line 50 of i18n_field.inc, which is the
It seems weird that a variable called "object" is being addressed with array syntax. |
Yes, I noticed that. D7 does exactly the same, but it doesn't throw the error. My suspicion is that this is a problem with i18n_string. |
LEt me know if you need other pointers to test what I have so far. As long as we enable profile_i18n after i18n_field and i18n_menu we'll be fine for testing. |
When that function gets called for the |
The original code for |
Thanks for looking into that, @bugfolder. I need to stop for a while today. In the meantime I pushed a couple of tweaks to the PR that are unrelated to that fatal error - the new stuff adds Translate to the dropdown button for profile types. |
Sure. I've added Spanish language, and added a translation for the label. Where do I find the setting to make that language appear for me? (Setting my user account to "Spanish" doesn't do it, it seems.) |
To see the Spanish translation add 'es' to any path, as in |
I just realized we need and update hook to update the profile type config files for existing installations. Will add thi later |
@bugfolder just pushed a couple of changes including an update hook for existing installations. Without it (if you patched an existing site) you most likely could not make the functionality work. The update hook adds Also fixed an oversight in the default main profile type config file. |
Hmm, |
Have you enabled URL detection at |
@bugfolder I found the bug that was causing the fatal error. It was the profile's implementation of I've fixed that in the last push, and the fatal error is gone! |
BTW these are more detailed directions for testing:
You can now enter some data in the profile. Then click on View to view the user page (in my case |
Ah, `admin/config/regional/language/detection was what I was missing. With that (and the latest PR, and running update.php) I can report that the translated profile label does appear on both the user view page and edit pages (and edit page for the individual profile). Also that enabling Field Translation doesn't crash. So this looks RTBC, functionality-wise. A few code comment typos, see the PR. |
...And I see those changes, so fully RTBC! |
Issue #25. Provide label translation for profile types
Follow-on to #23. H/T @argiepiano.
A PR from someone with translation experience would be most welcome!
The text was updated successfully, but these errors were encountered: