marcin Posted June 7, 2012 Share Posted June 7, 2012 Hi, it's kind of proposal - is it possible to replace "special" characters (e.g. ś, ć, ł,... in polish) after uploading a file? The same as in "Name" field(ł => l, ś => s, ...). Currently there are dashes, but if it works somewhere, there must be some replacement array for few languages. Thanks, Marcin Link to comment Share on other sites More sharing options...
Ben Posted June 7, 2012 Share Posted June 7, 2012 I'm not sure I fully understand what you are trying to do, but character encoding can be a hornets nest, especially if you are destructively transforming text. Assuming the characters are going into the database correctly, one non-destructive way would be to use a TextFormatter module to apply output formatting - something like this: class TextformatterReplaceChars extends Textformatter { public static function getModuleInfo() { return array( 'title' => 'Replace Characters TextFormatter', 'version' => 100, 'singular' => true, 'autoload' => true, ); } public function format(&$str) { $str = strtr($str, "äåö", "aao"); } } Edit: After re-reading, I think you may mean url name/slugs? Sorry if I missed the boat with my answer. Link to comment Share on other sites More sharing options...
ryan Posted June 8, 2012 Share Posted June 8, 2012 Currently ProcessWire only attempts translation on page names. There is some overhead with doing it, so we avoid it where possible (like with filenames). If there's more demand for doing this, or if we find ways to make it happen without extra overhead, it would certainly be a consideration down the road. Link to comment Share on other sites More sharing options...
marcin Posted June 10, 2012 Author Share Posted June 10, 2012 @Ben and @ryan, I understand, thanks a lot. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now