Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Untranslated strings??? #24168

Closed
brianteeman opened this issue Mar 11, 2019 · 14 comments
Closed

[4.0] Untranslated strings??? #24168

brianteeman opened this issue Mar 11, 2019 · 14 comments

Comments

@brianteeman
Copy link
Contributor

Steps to reproduce the issue

Enable debug language
All strings should be wrapped in **
Observe how many of the button are wrapped in ?? indicating untranslated but they are
I don't know if its a bug in the debug code or what

Examples

image

image

image

@SharkyKZ
Copy link
Contributor

It means the string is translated multiple times.

@infograf768
Copy link
Member

For Preview, it is quite simple

It is first translated in
https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Toolbar/ToolbarButton.php#L121
as every toolbar button by default

Then it is translated again in
https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/View/Article/HtmlView.php#L197-L200

This one can be solved here by modifying this last one to

				$url = PreviewHelper::url($this->item);
				$toolbar->preview($url, 'JGLOBAL_PREVIEW')
					->bodyHeight(80)
					->modalWidth(90);

to get
Screen Shot 2019-03-12 at 07 04 19

I could not find a way for Change Status

@hardik-codes
Copy link
Contributor

Started working on this.

@puneeth2001
Copy link
Contributor

puneeth2001 commented Mar 12, 2019

@SharkyKZ are you sure that this is being caused by repetition of strings, I can find the repetetion
in the 'preview' thing as @infograf768 said but couldn't find the repetetion in case of Change Status.

@puneeth2001
Copy link
Contributor

puneeth2001 commented Mar 12, 2019

image
I found these being called only once, i.e. in plugins/sampledata/blog/blog.php

@SharkyKZ
Copy link
Contributor

Site menus are not translatable.

are you sure that this is being caused by repetition of strings

Yes, it's because Joomla\CMS\Toolbar\Button\DropdownButton::prepareOptions() calls parent::prepareOptions() which translates the string and then uses the options to create a new button. But new button expects an untranslated string.

$button = new BasicButton($this->getName(), $this->getText(), $options);

@infograf768
Copy link
Member

Indeed
$this->getText() also uses Text::_

@puneeth2001
Copy link
Contributor

ok I get it thanks.

@infograf768
Copy link
Member

Preview double translation now solved:
#24178

Remains Change Status if it can be done.

@ghost
Copy link

ghost commented Mar 13, 2019

@infograf768 Issue stay open?

@infograf768
Copy link
Member

remains the Change Status issue to solve, if possible.

@ghost ghost added the J4 Issue label Apr 4, 2019
@brianteeman
Copy link
Contributor Author

@infograf768

Preview double translation now solved:
#24178

That's not the right PR?

@infograf768
Copy link
Member

The right PR was #24173

Reopening as Change Status issue is not solved yet.

@brianteeman
Copy link
Contributor Author

Closing - not worth keeping it open for this edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants