Opened 19 years ago
Closed 14 years ago
#1762 closed enhancement (worksforme)
permalinks structure not i18n friendly
Reported by: | anatman | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.1.2 |
Component: | Permalinks | Keywords: | needs-patch |
Focuses: | Cc: |
Description
The permalinks structure needs to get fields in the admin interface for $author_base, $search_base, $comments_base and $feed_base (all in classes.php), and for choosing the word used in paginating the site ("page" is hardcoded in $pageregex (classes.php) and in $page_modstring and $page_modregex (both in template-functions-links.php)), or these need to be internationalized.
The way it is harcoded now we have the english words "author", "comments", "feed" and "page" appearing in the permalinks.
Attachments (4)
Change History (40)
#2
@
19 years ago
I agree completely with markjaquith, and his way would probably make it easier to code, wright?
#3
@
19 years ago
- Keywords bg|has-patch bg|squashed added
- Owner changed from anonymous to davidhouse
- Status changed from new to assigned
Attached patch allows for customisation of author, feed and comment feed bases. Although all these may not be necessary (and are thus superfluous options and thus harmful), I've left them in because
- They can always be removed by the committor (easier to remove than to add them back in if someone decided we need them).
- They might be useful for i18n (although we should allow .po/.mo files to customise these bases).
#4
@
19 years ago
- Milestone set to 1.6
I don't think these need to be provisionable. Simply marking them for translation should suffice. In WP_Rewrite init():
$this->author_base = trim(__('/author/'), '/');
Slashes are included in the translatable string for context and then stripped back out.
This way the strings show up in the po files for translation, and we don't have to clutter the permalink page with settings.
#5
@
19 years ago
Please don't forget the word "page", which is hardcoded in $pageregex (classes.php) and in $page_modstring and $page_modregex (both in template-functions-links.php).
This word is quite important for translation because it is not an internet term like "feed", and it's meaning is the same as in other contexts.
#6
@
19 years ago
Patch attached that applies gettext to permalink bases.
I'm wary of this approach since permalinks will change if the translation is changed, making them not so perma. Persisting them in the DB means adding provisioning UI for all of these fields, which is ugly and annoying. Both approaches have drawbacks. Still debating the best way to go.
#7
@
19 years ago
Sorry to insist on this, but the hardcoding of the word "page" as noted above is bearing children: please take a look at the last version (0.41) of the Permalinks Redirect Plugin: http://fucoder.com/code/permalink-redirect/ (line 83). If in the future the word gets marked lots of people will have their permalinks breaking.
I just warned the plugin author.
#9
@
19 years ago
I would like also to point out that the browser must support "strange" chars if they are in the translation on the permalinks. I don't think that a chinese char is supported in the address bar of the lastests browsers. Am I wrong?
#10
@
19 years ago
My apologies for being a newbie at how to do this but I would like to vote for these two patches and suggest they fold into the next 2.1 alpha (3?)
The diff is for an old build so I am unable to apply to any 2.x version except for manual editing.
They test and work well, at least on my (US) english site.
I would also suggest a better ticket title, the ability to change permalink structure for "author" etc. is not just a language issue and would be handy to many.
#12
@
18 years ago
1762.diff
- Ryan's patch reapplied to current trunk.
- Use page_number_base to keep track of /page/
Note: change things and you'll have to update your permalink structure.
#14
@
18 years ago
- Keywords dev-feedback added; i18n bg|has-patch bg|squashed removed
- Owner changed from davidhouse to rob1n
- Status changed from assigned to new
I am +1 for making these options in Options > Permalinks. There are many times I wanted to change things like the feed base, the author base, or etc.
#21
@
18 years ago
- Keywords has-patch needs-testing added; dev-feedback removed
- Milestone changed from 2.3 to 2.2
#25
@
18 years ago
- Keywords needs-testing removed
Okay, that's what I have so far. Feeds+comment feeds aren't working. If you try to click on a link in Kubrick, at the bottom, you'll see what I mean.
I'll keep debugging this in the morning.
#27
@
17 years ago
- Milestone changed from 2.3 to 2.4 (next)
This sounds like a very good idea.
Although I am not sure about overloading the Permalinks options page with extra options - maybe we should use filters instead and require a plugin to do the name changes?
Moving to 2.4 as it's too late to make a bit change like this to 2.3
#31
@
16 years ago
- Type changed from enhancement to defect
Bump. This has been here for 3 years now, and the problem is spreading: in 2.7RC1 we have the words "comment-page" hardcoded on line 1262, and "attachment" on line 1421 (in rewrite.php).
On the other hand tag_base is an option in the admin area (pemalinks) - which is not only nice, but makes sense.
All "bases" should be configurable via the admin interface.
#32
@
16 years ago
- Component changed from Administration to Permalinks
- Keywords needs-patch early added; has-patch needs-testing removed
- Milestone changed from 2.9 to 2.8
- Type changed from defect to enhancement
I agree that the permalinks should be translatable, and I'm closing #8312 as a duplicate of this.
Attached patch is stale, and probably needs to be reworked either way.
(Its an enhancement, not a defect)
should this be customizable via an options interface or via plugins or via i18n? I can think of even English-speakers who would want to change this, like /author/ => /artist/ or /contributer/ or something else, so maybe these should be options on the permalink options page.