t('Not sure what to do? Try the "!getting-started" page.', array('!getting-started' => $getting_started));
Could become very difficult...

An error occurred at
Could become very difficult, too.

I will post more when I found more... could take some time.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

I'd like to log some more issues here... and afterwards we go over and try to fix all.

Invalid display id while regenerating tabs
Wouldn't it clearer to say Invalid display id found while regenerating tabs or have I understood this wrong?

hass’s picture

View analysis can find nothing to report.
For my understanding... does this mean View analysis cannot find anything newsworthy.? Should be more context sensitive...

hass’s picture

What single character to use as a decimal point.
What single character to use as the thousands separator.
Text to put before the number, such as currency symbol.
Text to put after the number, such as currency symbol.

When I saw this strings I wonder much... this is something that *will* dynamically change per language view... and we have a language switcher in D6 - so this strings are not wrong, but the logic behind sounds really wrong.

hass’s picture

Displays the default summary summary as a list.
Looks like one "summary" too much.

hass’s picture

Aside it would be good to change the many "query" to be more explainable like "database query" when it is a db query. This makes translation also easier.

hass’s picture

This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to !break.
One more string that is not context sensitive.

merlinofchaos’s picture

t('Not sure what to do? Try the "!getting-started" page.', array('!getting-started' => $getting_started));
Could become very difficult...

Why? That's a perfectly valid string.

What single character to use as a decimal point.
What single character to use as the thousands separator.
Text to put before the number, such as currency symbol.
Text to put after the number, such as currency symbol.

When I saw this strings I wonder much... this is something that *will* dynamically change per language view... and we have a language switcher in D6 - so this strings are not wrong, but the logic behind sounds really wrong.

I use the PHP tools I am given. Those strings are should at least be run through t(). Not ideal, I know, but that's what we got.

Aside it would be good to change the many "query" to be more explainable like "database query" when it is a db query. This makes translation also easier.

No.

This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to !break.

Look, this is the Drupal standard for embedding links into text. I'm sorry if it's hard to translate, but making it easy to translate means making really ugly strings. Cope with it.

hass’s picture

Display comments only if a user posted the node or commented on the node.
How is is possible that a comment to a node exists if the node is not yet saved/posted?!?

hass’s picture

Only the checked roles will be able to access this display. Note that users with \"access all views\" can see any view, regardless of role.
Should be Only the checked roles will be able to access this display. Note that users with \"access all views\" can see any view, regardless of their role.

hass’s picture

t('Not sure what to do? Try the "!getting-started" page.', array('!getting-started' => $getting_started));
Why? That's a perfectly valid string.

The main issue is context sensitive. If you translate "!getting-started" used in several ways you are lost as you are unable to get the translation of the place holder to meet for more then one place. It could be simply solved in a way how core have done in D6.

For example:
t('Not sure what to do? Try to <a href="@link">install the advanced help module</a> for the getting started page.', array('@link' => $advanced_help_install_link));

Now we have a context sensitive translation that will work in all languages for sure! Also take a look into D6 core if you don't trust me... or ask Gabor... :-) Aside the string seem to contain a typo I fixed above ("Try to install the advanced help..." vesus "Try the 'Install the advanced help...' ... ").

Completely the same will happen here:
This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to !break.

hass’s picture

There is an unfixed exposed> in the code that should be exposed

hass’s picture

There are many problematic strings in includes/plugins.inc like:
t('You may also adjust the !settings for the currently selected style by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'style_options')))

We need to change the function option_link to solve this.

hass’s picture

Status: Active » Needs work
FileSize
41.12 KB

This is the first step... it's not complete, I've reached modules/node.views.inc from top of all files. plugins.inc stuff needs to be done and the rest of the files needs review.

hass’s picture

Assigned: Unassigned »
Status: Needs work » Needs review
FileSize
60.49 KB

New patch attached.

It does not yet fix all context sensitive strings as I understand the problem with this strings (from #7), but nevertheless this bugs should also be fixed later. As reference see the "example of incorrect usage of t()" in http://api.drupal.org/api/function/t/6, please.

merlinofchaos’s picture

Are you continuing to work on this patch?

Here is my review of what is currently here:

-        vpr(t('set_display called with invalid display id @display', array('@display' => $display_id)));
+        vpr(t('Set_display called with invalid display id @display.', array('@display' => $display_id)));

The original is correct; the function is set_display() not Set_display(). Since we're using a function name, the case matters. A feasible correction would be:

+        vpr(t('set_display() called with invalid display id @display.', array('@display' => $display_id)));
@@ -907,7 +907,7 @@
     if (!empty($this->definition['many to one'])) {
       $form['add_table'] = array(
         '#type' => 'checkbox',
-        '#title' => t('Allow multiple arguments to work together.'),
+        '#title' => t('Allow multiple arguments to work together'),
         '#description' => t('If selected, multiple instances of this argument can work together, as though multiple terms were supplied to the same argument. This setting is not compatible with the "Reduce duplicates" setting.'),
         '#default_value' => !empty($this->options['add_table']),
       );
@@ -1047,7 +1047,7 @@
 
     $form['not'] = array(
       '#type' => 'checkbox',
-      '#title' => t('Exclude the argument'),
+      '#title' => t('Exclude the argument.'),
       '#description' => t('If selected, the numbers entered in the argument will be excluded rather than limiting the view.'),
       '#default_value' => !empty($this->options['not']),
     );

One of the above is incorrect; I think it's probably the second one. Both are checkboxes and we don't ordinarily put periods on checkbox titles.

-    $getting_started = t('Install the advanced help module for the getting started');
+    $getting_started = t('Install the advanced help module for the getting started.');
   }
 
   $vars['help'] = t('Not sure what to do? Try the "!getting-started" page.', array('!getting-started' => $getting_started));

This change results in this sentence:

Not sure what to do? Try the "Install the advanced help module for the getting started." page.

That period doesn't belong, IMO.

-            drupal_set_message(t('@type handler @table.@field is not available.', array(
+            drupal_set_message(t('@type handler @table. @field is not available.', array(

That period is a delimiter, not an end of sentence, as in x.y -- for example, node.title

-  $vars['base_table'] = !empty($table['table']['base']['title']) ?
-    $table['table']['base']['title'] : t('Unknown or missing table name');
+  $vars['base_table'] = !empty($table['table']['base']['title']) ? $table['table']['base']['title'] : t('Unknown or missing table name.');

I like to format my code to 80 columns when there's a convenient way to do so. That ? made it convenient, so I'd prefer to leave that cr+tab in.

       'title' => t('Export'),
-      'alt' => t("Export this view"),
+      'alt' => t('Export this view'),
       'href' => "admin/build/views/export/$view->name",
     ),
     array(
       'title' => t('Clone'),
-      'alt' => t("Create a copy of this view"),
+      'alt' => t('Create a copy of this view'),
       'href' => "admin/build/views/clone/$view->name",

Shouuldn't you have added periods to these while making those changes? Alt text seems like it should have periods too. (I wish I were less sloppy about that, but I seem to just make that error by habit.)

@@ -983,8 +982,8 @@
       $path = $display->handler->get_path();
       if (strpos($path, '%') === FALSE && !isset($paths[$path])) {
         $vars['quick_links_raw'][] = array(
-          'title' => t('View "!display"', array('!display' => $display->display_title)),
-          'alt' => t("Go to the real page for this display"),
+          'title' => t('View %display', array('%display' => $display->display_title)),
+          'alt' => t('Go to the real page for this display.'),
           'href' => $path,
         );
         // Displays can have the same path; no point in showing more than one link.
@@ -1247,7 +1246,7 @@

The above text is link text; using % instead of ! will result in a double check_plain on the display title, causing double encoding ickiness if someone puts special characters in the display name. Also, I'm not comfortable adding an em inside link text.

-    $ret[] = views_ui_analysis(t('This view has only a default display and therefore will not be placed anywhere on your site; perhaps you want to add a page or a block display.'), 'warning');
+    $ret[] = views_ui_analysis(t('This view has only a default display and therefore will not be placed anywhere on your site. Perhaps you want to add a page or a block display.'), 'warning');

Are you allergic to semi-colons? I realize I overuse them but you're removing perfectly valid ones.

-    '#description' => t('Enter an optional tag for this view; it is used only to help sort views on the administrative page.'),
+    '#description' => t('Enter an optional tag for this view, that is used only to help sort views on the administrative page.'),

This change creates an invalid clause. In your version the comma should not appear. My version breaks it into distinct thoughts "do this; why", which I personally find easier for a user to interpret, but that's a matter of opinion.

-      $options = array('' => t('<None>'));
+      $options = array('' => t('- None -'));

Why?

   function render($values) {
-    $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
+    $text = !empty($this->options['text']) ? $this->options['text'] : t('View');
     $nid = $values->{$this->aliases['nid']};
     return l($text, "node/$nid");
   }

While there may be some inconsistency, generally within Drupal whenever there is an operations link (see admin/content/node-types and admin/content/node) the operations are not upper-cased. These should remain lowercase. Also see Drupal's node/XXX/revisions for the 'revert' example.

@@ -284,7 +284,7 @@
       'relationship' => 'none',
     ),
   ));
-  $handler->override_option('title', 'Today\'s popular content');
+  $handler->override_option('title', "Today's popular content");
   $handler->override_option('items_per_page', 5);
   $handler->override_option('link_display', 'page_1');
   $handler->override_option('style_plugin', 'list');
@@ -298,7 +298,7 @@

Don't bother changing these; these are generated from an export, and the export will never be smart enough to choose between ' and " intelligently. The next time the export is updated this will just be reverted.

@@ -12,6 +12,6 @@
 
 <div class="more-link">
   <a href="<?php print $more_url ?>">
-    <?php print t('more'); ?>
+    <?php print t('More'); ?>
   </a>
 </div>

About a year ago there was a long thread about the more link. The end result: try to keep it just like Drupal's. Leave it lowercase.

hass’s picture

Status: Needs review » Needs work
hass’s picture

Status: Needs review » Needs work

Thank you for the feedback and corrections:

+        vpr(t('set_display() called with invalid display id @display.', array('@display' => $display_id)));

I fixed the set_display() as suggested.

'#title' => t('Exclude the argument'),

Removed the wrong period.

drupal_set_message(t('@type handler @table.@field is not available.', array(

Removed the wrong blank.

-  $vars['base_table'] = !empty($table['table']['base']['title']) ?
-    $table['table']['base']['title'] : t('Unknown or missing table name');
+  $vars['base_table'] = !empty($table['table']['base']['title']) ? $table['table']['base']['title'] : t('Unknown or missing table name.');

I'd like to keep this change as is. It's a Drupal code style and I have had Garbor in my mind who said often "we have good editors that wrap for us"... that's mostly the why + I find it more readable, but I wouldn't fight for this very much if you don't like it.

       'title' => t('Export'),
-      'alt' => t("Export this view"),
+      'alt' => t('Export this view'),
       'href' => "admin/build/views/export/$view->name",
     ),
     array(
       'title' => t('Clone'),
-      'alt' => t("Create a copy of this view"),
+      'alt' => t('Create a copy of this view'),
       'href' => "admin/build/views/clone/$view->name",

Well I thought about adding periods here, but decided first, not. It thought it's like a title... but otherwise not... I was uncertain what to do here. So - now added the periods.

Are you allergic to semi-colons? I realize I overuse them but you're removing perfectly valid ones.

Yes, a little bit - if used as sentence delimiter. I'm not sure why you like them and it may be valid to use them here, but have you ever read a book that delimit all sentences with semicolons? I'm not... :-)

-    '#description' => t('Enter an optional tag for this view; it is used only to help sort views on the administrative page.'),
+    '#description' => t('Enter an optional tag for this view. It is used only to help sort views on the administrative page.')

I turned this to the above for now and hope this one is better for you, nevertheless it wasn't "wrong" in past. If I look through core sentence I see such semicolon constructs in very rare situations only. As this is such rare I expect it is flipped through some other fingers on the string review :-). But not sure...

-      $options = array('' => t('<None>'));
+      $options = array('' => t('- None -'));

No big thing - the new string is a reusable core string from taxo module. yched have done this change in CCK and I thought to follow him...

   function render($values) {
-    $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
+    $text = !empty($this->options['text']) ? $this->options['text'] : t('View');
     $nid = $values->{$this->aliases['nid']};
     return l($text, "node/$nid");
   }

Reverted back. However I wonder... I will take a look to core. I thought we have only upper-case first operation names as this makes it easier to distinguish where it starts and ends or you have multi-word operations.

-  $handler->override_option('title', 'Today\'s popular content');
+  $handler->override_option('title', "Today's popular content");

Reverted back.

<div class="more-link">
   <a href="<?php print $more_url ?>">
-    <?php print t('more'); ?>
+    <?php print t('More'); ?>
   </a>
</div>

Reverted back.

       if (strpos($path, '%') === FALSE && !isset($paths[$path])) {
         $vars['quick_links_raw'][] = array(
-          'title' => t('View "!display"', array('!display' => $display->display_title)),
-          'alt' => t("Go to the real page for this display"),
+          'title' => t('View %display', array('%display' => $display->display_title)),
+          'alt' => t('Go to the real page for this display.'),
           'href' => $path,
         );

It is somewhat difficult to figure out what is check_plain'ed and what not... I turned this back for now. The placeholder stuff is something i'm not sure what direction we should go. Normally I think here should be an EM'd value as it would otherwise becomes difficult to figure out if this is a name from something outside. The double quotes are helpful here and make this clear, but what is about t('Display plugin @plugin is not available.', ... that seems to be wrong. You are adding a string from outside - inside a sentence. I think this should all be %plugin to add the theme placeholders!?

-    $getting_started = t('Install the advanced help module for the getting started');
+    $getting_started = t('Install the advanced help module for the getting started.');
   }

   $vars['help'] = t('Not sure what to do? Try the "!getting-started" page.', array('!getting-started' => $getting_started));

This is one of the open TODO's. You can see how buggy this context sensitive sentence is... He need to change this, but I'm not yet sure how. See #10 where I already wrote how this should looks like.

hass’s picture

Status: Needs work » Needs review
FileSize
56.44 KB

Re-roled patch attached.

hass’s picture

I'm unsure about some periods in checkbox titles...

zirvap’s picture

About the string "View" and/or "view": Is this view-as-verb or view-as-noun?

View-as-noun is problematic since "View" and "view" are used as verbs in core (like the tab on http://drupal.org/user). For some languages there's no word or expression which can cover both meanings.

In core D6, a similar problem ("May as long month name" = "May as short month name" in English, but not in all other languages) was solved by introducing the string "!long-month-name May", while keeping the string "May" for the short version.

Is it possible to use a "!noun View" for those cases where we're talking about "a view", and not "to view"?

pwolanin’s picture

Version: 6.x-2.0-rc1 » 6.x-2.x-dev
Status: Needs work » Needs review
FileSize
14.84 KB

here are some minimal fixes pulled from the last patch. Skipped most of the punctuation/capitalization suggested changes.

pwolanin’s picture

missed the change to the template file.

merlinofchaos’s picture

Status: Needs review » Fixed

Ok, I committed pwolanin's stripped down version. I realize there are other issues remaining but some of them require more thought. It's best to do the ones that require thought separately and get the easy ones in.

merlinofchaos’s picture

Oh and let's separate ones that require thought into separate issues.

zirvap’s picture

Is the "view as noun" vs "view as verb" thing in #20 one of those that require thought?

merlinofchaos’s picture

zirvap: Sorry, yes it may be. I think it may only matter if View is ever used as a standalone, though, which I'm not sure it is.

zirvap’s picture

No problem, I'm just wondering whether I should start a new issue for this or not.

Searching for "view" in http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/views/trans... results in

#: modules/comment/views_handler_field_comment_link.inc:34 modules/node/views_handler_field_node_link.inc:35 modules/user/views_handler_field_user_link.inc:38
msgid "view"

I've no idea if that's a view-as-verb or view-as-noun context, though.

hass’s picture

@zirvap: that's difficult to answer in general... :-) I'm often search the code for e.g. 'view' and if this makes things not clear, try to find it from UI side... but I understand this is sometimes not easy to translate or untranslatable. Often it is much easier for all to try to make the single word context sensitive by changing into a sentence or being more descriptive with 2-3 words... this could solve the problem in many cases, but not all. Not sure how to solve in general.

merlinofchaos’s picture

Those you list are all 'view' as verb -- they are links to objects (content, comment, user) with 'view' as the default link text, in the same manner that core uses it.

zirvap’s picture

Aha, then there's no problem -- or at least, there's no problem with ambigious translations of the string "view" :-)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.