Options page translation

  • Problem
  • Updated 4 years ago
I'm working on translation of the theme and I'm stuck with one problem.

Options page uses heading names to generate id , then this id used to switch tabs

but if I translate heading ( ex. Layout Options ) then the id is not generated - it is empty. And tabs become nonoperational.
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes

Posted 4 years ago

  • 1
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
Fixed ! works now.
Photo of Allan Cole

Allan Cole, Owner

  • 2047 Posts
  • 112 Reply Likes
Great! What was the issue? (Just in case anyone else asks?)
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
The issue with options framework was in options-interface file. Tabs ID generated from names of headings so when you translate headings script doesn't understand your language.

I added ID into an array to each heading in autofocus-options. Id => "one" , then two then three.

Then in options-interface replaced value['name'] with value['id']

So I translated front side and options page in admin. BUT (huge but)

I'm stuck again - now with post-meta-boxes. I need a push
Photo of Allan Cole

Allan Cole, Owner

  • 2047 Posts
  • 112 Reply Likes
Interesting. I’ll take a look at it myself as well.
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
One more thing
I can't find where "Leave a Reply" comes from.

I can't see it in autofocus-filters not in functions.php and not in comments.php
Search gives nothing. Seems like it is in some wordpress file.

BTW. Translating theme I have discovered a few things that need to be corrected.
Photo of Allan Cole

Allan Cole, Owner

  • 2047 Posts
  • 112 Reply Likes
“Leave a Reply” is from a default setting in WordPress. I would imagine using a translated version of WordPress would probably come with it already translated but i’m not 100% sure. I’ll look into it.

What other errors have you found?
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
I will start a list here.

autofocus-help.php : the text is not wrapped with translation tag __()
there is a typo "Shortcuts" should be "Shortcodes"

functions.php : autofocus_nav_above and autofocus_nav_below - translation tag
is missing . It is a little bit tricky : you should put 'autofocus' just
before %title

comments fields filter also need to add translation tag __()
for the text that appears inside text fields ( First Name and/or....
and What's on your mind )
also there is a typo - 'Comment', 'noun' - noun replace with 'autofocus'

autofocus-options.php: Flickr Options missing translation tag.
also Flickr Options appears twice - not sure if it is a problem
If keep this way then the phrase Flickr Options appears
three times. but It is just the way Options Framework built.

I still can't find the fix for post-meta-boxes. I was able to translate the title "AutoFocus Post Options" , but can't get content of the box translated. It is, probably, in front of my eyes, but I can't see it.
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
Options-framework.php down there __('Theme Options') need to add 'autofocus'
to have "Theme Options" in the menu translated.

There are few other words in options-framework.php and options-upload.php that need 'autofocus' , but I want to be 100% sure about them.

I have checked every file then updated *.po file - I've got 183 strings.
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
in comments.php - Required fields are marked - need to add __()
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
I've translated 99% - menus, buttons, instructions and text. Tested with wordpress in targeted language - no English words found.

I just need help with post-meta-boxes !

Then I'll be ready to release the translation.
Photo of Allan Cole

Allan Cole, Owner

  • 2047 Posts
  • 112 Reply Likes
Great! Give me a couple days to look into this... There’s a few bugs I want to address that may require you to update the translations.

Thanks.
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
Allan, I have cracked it ! Post-meta-boxes translated now.

Well, if anyone wants to know:
To translate meta-boxes you can do a simple hack, which requires just a few symbols to add

or

wrap $af_post_meta_boxes in a function then at the end of the function
return apply_filtes('this_function', $af_post_meta_boxes);
Photo of AxelYa

AxelYa

  • 548 Posts
  • 105 Reply Likes
AF 2.0.2 - archive-page - lines 22, 29 : replace thematic with autofocus