Closed (duplicate)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Jun 2011 at 20:34 UTC
Updated:
19 Apr 2026 at 18:34 UTC
Jump to comment: Most recent
Comments
Comment #1
dave reidSo wouldn't you just edit the textfield at admin/config/search/path/settings to use french words then?
Comment #2
Freso commentedhttp://api.drupal.org/api/drupal/includes--bootstrap.inc/function/t/7 says:
So no, this will not happen. As Dave said, simply change the words in your local setup. For multilingual sites, the Internationalization suite has a module for translating site variables, including the "Strings to remove" one.
Comment #3
SebCorbin commentedFirstly, this is not a variable, it's a constant. So it can be translated, as says in your link :
A constant is defined by the developer, no user-entered text.
And secondly, when I'm installing Pathauto on my french site, I hope to see french words removed (I mostly don't care about english ones) without being obliged to configure this every time I build a site.
Comment #4
SebCorbin commentedComment #5
dave reidIt *is* a variable. Hence variable_get() is used. You are able to change the value of this variable at admin/config/search/path/settings. Trust me, you can.
Comment #6
SebCorbin commented(please let's discuss this without changing status... for now)
I know I can change the value, but I'm requesting this for localization matter, I've run a search on Pathauto issue queue and found many topic related to this problem (with italians requesting to have their default words too):
- internationalization (i18n) must not be a dependency to do this, as it's not part of traditional localization (l10n)
- your module is not fully translated because of this default string
If you consider you cannot use t() inside variable_get(), consider using it in define() then. What's wrong with that?
Comment #7
dave reidYou cannot use t() with define(). The item has to be a string or numeric value only, and cannot be the return value of a function.
Comment #8
SebCorbin commentedThis constant is only used twice if I remember correctly, would it be possible to have it inlined?
Comment #9
dave reidThe other problem for this is this string shouldn't be translated per say, it's the list of the language's short words that do not have meaning - they may not all translated 100% from English to the desired language, or the language may have additional words that should be ignored.
Comment #10
SebCorbin commentedOk, you got it, we're in a dead end, I'll always have this module 99% translated...
Comment #11
hanno commentedbump. See this issue on several Dutch sites, where some words disappear in the alias while others stay and the owners are unaware. It would be better for localisation to make this string translatable. An alternative would be that the default of the field is blank and have the words as suggestions in the description of the field, and not as default value.
@Dave Is there a reason that a constant is used and not a variable_set() in pathauto_install()?
Comment #12
ludo.rCould someone tell me where to find this?
I can't find it in admin/config/regional/i18n/variable.
Comment #13
Freso commentedWhich doesn't mean at all that the string couldn't be a candidate for translating. Translation, or in this case: localisation, does not mean mapping each word 1:1. It's taking the essence/meaning of a given string and convert it to make sense in the target language/locale. A string of small commonly used words that should likely not be used in a path alias which is overly English-ish would be a good candidate for localisation.
However, as has been said elsewhere in this issue, there are two good ways to do just this, depending on the site in question (whether it be mono- or multi-lingual).
@dolu:
You can read about variable translation on https://drupal.org/node/1113374 - the variable in question is "pathauto_ignore_words".
Comment #14
ludo.r@Freso:
Thanks for pointing me to this page. That's exactly where I expected to find this variable, however it is not available.
Am I missing something?
I'm using pathauto 7.x-1.2
Comment #15
hanno commented@Freso Still an interesting discussion. In the API is indeed mentioned that you shouldn't use t() for variables, but mentioned are php variables (t($text)), not a Drupal persistent variable default. Translation of the default of Drupal variables is done in Drupal core itself as well, for example in
http://api.drupal.org/api/drupal/modules!system!system.admin.inc/functio...
'#default_value' => variable_get('maintenance_mode_message', t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))),The exact same logic to add t() for the default value of the variable we could use in
This way, the variable is translatable, and, when this module gets installed, gets directly the right language, without the need for i18n. See also a discussion in external links module #672500: Translatable Variable Defaults
Comment #16
pbouchereau commentedhttps://www.drupal.org/project/pathauto/issues/2630382
Comment #17
pbouchereau commented