Closed ckjpn closed 4 years ago
As I was posting a sentence in Facebook, I was reminded that a slight change, might make tatoeba.org's pages more social media friendly, too.
https://tatoeba.org/eng/sentences/show/5100337
Perhaps how this should be done needs to be discussed, but here are my suggestions.
FROM:
<title> English example sentence: Dogs have masters, cats have servants. - Tatoeba </title>
TO:
<title> Dogs have masters, cats have servants. - English example sentence - Tatoeba </title>
FROM:
<meta name="description" content="Browse translated example sentences. This page shows translations and information about the sentence: Dogs have masters, cats have servants." />
TO:
<meta name="description" content="Visit the Tatoeba Project to find example sentences and their translations. You can add a translations into your own language, too." />
[EDITED: 2016-10-03]
TO:
<meta name="description" content="Dogs have masters, cats have servants. You can see translations, if they exist, on this page, or add a translation if one doesn't already exist." />
[EDITED: 2016-10-03]
I'm not sure exactly what wording you would want in the "description", but including the sentence at the beginning of the description would help display the complete sentence in Google results for longer sentences that get cropped short in the link.
If this isn't too long, then adding the following after the sentence in the "description", would convey information that would be useful to anyone seeing the results on Google.
"You can see translations, if they exist, on this page, or add a translation if one doesn't already exist."
I would like to re-request this be done.
If you drag a bookmarks into the "bookmarks bar" all links look the same, since nothing unique is showing.
Maybe others never do this, but I often do this when I want to temporarily bookmark something I want to come back to in the near future.
Even if others don't do this, I can't see any disadvantage to anyone if the TITLE tag is done this way.
Additionally, when multiple tabs are open, a user can't tell which tab is which.
This should be a relatively simple thing to do. Is there any reason it's not a good idea?
It's interesting that sometimes Google doesn't include the "English example sentence: " or the " - Tatoeba" in the link.
I wonder whether this is a difficult change to make, or whether you think it wouldn't be useful.
I'll include 2 images to show why I don't like the way it's being done now, so perhaps you might consider prioritizing this.
browser tabs
google search
I think it’s a reasonable change. And it’s not difficult to implement.
@ckjpn You mentioned in #1122 that you'd be more interested to help with the code if we don't use an obsolete version of CakePHP. If you haven't changed your mind, now that we migrated to CakePHP 3, perhaps making a pull request for this issue would be a good place for you to start.
I don't have time to set things up right now, but perhaps this is the relevant code.
LINE 40 of Sentences/show.ctp
$title = format(__('{language} example sentence: {sentence}'),
array('language' => $languageName, 'sentence' => $sentenceText));
$this->set('title_for_layout', $this->Pages->formatTitle($title));
@ckjpn Yes, this is the relevant code. Maybe you don’t need to set anything up for such a trivial change. Just fork the repository, edit the file directly from Github (top-right pen icon) and make a pull request. We’ll take care of the rest.
@ckjpn I can see you already forked the repository a long time ago. Try this guide to update it first, or maybe just delete and recreate it.
Perhaps it's something as easy as this.
$title = format(__('{sentence} - {language} example sentence'), array('language' => $languageName, 'sentence' => $sentenceText)); $this->set('title_for_layout', $this->Pages->formatTitle($title));
@ckjpn The code you posted looks fine. If you can make a pull request out of this, then it's even better.
Pull requests are a very powerful tool for contributing code. There is of course a learning curve, and it may feel intimidating to make pull requests at first, but don't be afraid to try it.
This issue here has a very low urgency. It doesn't need to be solved today, nor tomorrow, nor even this month. That's why I suggested this as a starting point, so you can take the time you need to learn how to make pull requests. That knowledge will be useful for many other occasions in the future.
This is of course assuming you want to keep helping with the code. If you don't (which is completely fine), then learning how to make pull requests is useless.
I plan to get into CakePHP to potentially use it for another project. I didn't really want to take the time to read all the documentation and start experimenting with it until Tatoeba was using the current version. However, I don't really have time to do this at this time.
If it's too hard for one of you to make this change at this time, it can wait.
Pull requests are a feature of GitHub that allows to suggest modifications of code. They are not a CakePHP feature.
If you don't have time right now it's okay, as said, this is not urgent. The change in itself is not difficult. The reason why it has not been solved all this time was not because it was hard, but because it was never a priority.
It's not bad anyway to wait a bit more before introducing this change. There are maybe some impacts we haven't thought of. At least one thing that came up to my mind is that it could change our visibility in Google, especially if we don't make sure to fix the translated strings. But I don't think that should matter over having more practical tab titles.
I understand that it's not a CakePHP feature. What I meant is that I hate to make a suggested code change without testing it first and that I can't easily test it at this time. I don't think I could quickly set up tatoeba code to work locally.
@ckjpn FYI gillux made notable improvements in Imouto. Setting up Tatoeba locally should be a lot easier now. You may want to give it a try. Cf. https://tatoeba.org/eng/wall/show_message/32237#message_32237
Instead of: English example sentence: Is eating liver good for you? - Tatoeba Have this: Is eating liver good for you? - English example sentence - Tatoeba Or this: Is eating liver good for you? - English example sentence Or this: Is eating liver good for you? (English example sentence)
Currently Google Results look like this.
\ Related Idea **
Perhaps it might also be a time to reconsider what's in the description META tag. Perhaps it could be made more useful. For example, if it doesn't slow things down too much, you could have a line like the following instead, based on what the direct translations are.
Translations in: Japanese, French, Russian