Closed (fixed)
Project:
Node Add Title
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2014 at 03:14 UTC
Updated:
12 Nov 2015 at 18:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mastoll commented@rooby,
If you remove the the t() calls, what other function would you use to accomplish the same objective?
Comment #2
kopeboyYes please, @rooby
How should we then translate the titles?
Comment #3
rooby commentedYou don't.
For example, the code should be like this:
This will be safe from malicious users because drupal_set_title() runs all text through check_plain() by default (although it give you to option to disable that in case you want to use filter_xss() or something instead).
Default drupal translation is only for text you hard code into your modules.
Anything that users enter is not translated.
If the user wants, they can enter the titles in another language.
For more information see https://www.drupal.org/developing/api/localization
From that page:
If you have a site that you want to be in multiple languages then the user needs to be able to enter titles in multiple languages.
To do that you can use the internationalization module, which depends on the variable module.
Internationalization has string translation abilities so that you don't really have to do anything, however if you want to provide additional integration you can implement hook_variable_info() like is illustrated on the variable module project page.
Comment #4
nupur.lohokare commentedComment #5
nupur.lohokare commentedHi rooby,
Found the issue you mentioned and removed the t() function from drupal_set_title().
Thanks
Nupur
Comment #6
anup.singh commentedHi nupur.lohokare,
Patch looks good to me. Can be enrolled to Dev branch.
Thanks
Anup
Comment #8
jcmartinezComment #9
jcmartinez