[06:19:32 EDT(-0400)] * phiggins (n=dante@c-68-34-199-67.hsd1.tn.comcast.net) has joined #fluid-work <ecochran> * @param template a string (can be HTML) that contains markers embedded into it (markers are formatted as %0, %1, etc. and must be consecutive) <ecochran> * @param strings simple array of strings (number of array elements should match the number of markers
[09:30:34 EDT(-0400)] * anastasiac (n=team@142.150.154.105) has joined #fluid-work
[09:45:25 EDT(-0400)] * theclown (n=theclown@142.150.154.101) has joined #fluid-work
[11:05:43 EDT(-0400)] * colinclark (n=colin@142.150.154.101) has joined #fluid-work
[12:48:06 EDT(-0400)] * colinclark (n=colin@142.150.154.101) has joined #fluid-work
[12:51:59 EDT(-0400)] * apetro-_ (n=apetro@wsip-98-174-242-39.ph.ph.cox.net) has joined #fluid-work
[13:23:11 EDT(-0400)] * apetro-_ (n=apetro@wsip-98-174-242-39.ph.ph.cox.net) has joined #fluid-work
[13:37:18 EDT(-0400)] * jensmh (n=jensmh@128.189.220.2) has joined #fluid-work
[13:39:50 EDT(-0400)] <jensmh> Was anyone else having problems with the wiki and build sites earlier?
[13:40:01 EDT(-0400)] * phiggins (n=dante@c-68-34-199-67.hsd1.tn.comcast.net) has joined #fluid-work
[13:51:39 EDT(-0400)] * apetro-_ (n=apetro@wsip-98-174-242-39.ph.ph.cox.net) has joined #fluid-work
[13:58:51 EDT(-0400)] * apetro-- (n=apetro@12.164.139.7) has joined #fluid-work
[13:59:10 EDT(-0400)] * apetro--_ (n=apetro@wsip-98-174-242-39.ph.ph.cox.net) has joined #fluid-work
[14:26:01 EDT(-0400)] * apetro--_ (n=apetro@wsip-98-174-242-39.ph.ph.cox.net) has joined #fluid-work
[15:01:20 EDT(-0400)] * ecochran (n=ecochran@dhcp-169-229-212-38.LIPS.Berkeley.EDU) has joined #fluid-work
[15:02:27 EDT(-0400)] <ecochran> michelled, anastasiac, colinclark: I wrote a little string template function for fluid.util
[15:02:48 EDT(-0400)] <ecochran> basically takes a string with markers and replaces all the markers with new strings from an array
[15:06:02 EDT(-0400)] <ecochran> I'm using it in Uploader to format user feedback strings
[15:06:02 EDT(-0400)] <ecochran> I'll check it in shortly
[15:06:02 EDT(-0400)] <michelled> ecochran: will that work for i18n?
[15:06:02 EDT(-0400)] <ecochran> good question
[15:06:02 EDT(-0400)] <michelled> meaning, can we build up meaningful strings in other languages?
[15:06:02 EDT(-0400)] <ecochran> yes, both the template and the source strings would need to localized
[15:06:02 EDT(-0400)] <ecochran> the marker is %0 (which is fairly standard
[15:06:02 EDT(-0400)] <ecochran> and will be fine in UTF-8
[15:06:02 EDT(-0400)] <ecochran> I think
[15:06:02 EDT(-0400)] <ecochran> don't know a lot about localization
[15:06:02 EDT(-0400)] <ecochran> on the web
[15:06:02 EDT(-0400)] <ecochran> anyone there have any experience
[15:06:02 EDT(-0400)] <ecochran> ?
[15:06:13 EDT(-0400)] <ecochran> oh, outside of utf-8, % might be mapped to a meaningful character
[15:06:18 EDT(-0400)] <ecochran> again, I don't know a lot
[15:06:35 EDT(-0400)] <ecochran> this is designed to be really lightweight
[15:06:55 EDT(-0400)] <ecochran> /**
[15:06:55 EDT(-0400)] <ecochran> * simple string template system
[15:06:55 EDT(-0400)] <ecochran> * returns a new string with markers replaced with new strings
[15:06:55 EDT(-0400)]
[15:06:56 EDT(-0400)]
[15:06:56 EDT(-0400)] <michelled> ecochran, I don't have a lot of localization experience. I was just wondering about translations
[15:06:57 EDT(-0400)] <ecochran> */
[15:06:59 EDT(-0400)] <ecochran> fluid.utils.stringReplace = function (template, strings) {
[15:07:01 EDT(-0400)] <ecochran> var newString = template;
[15:07:03 EDT(-0400)] <ecochran> var count = 0;
[15:07:05 EDT(-0400)] <ecochran> for(index in strings) {
[15:07:07 EDT(-0400)] <ecochran> var searchStr = "%"+index;
[15:07:09 EDT(-0400)] <ecochran> newString = newString.replace(searchStr,strings[index]);
[15:07:11 EDT(-0400)] <ecochran> }
[15:07:13 EDT(-0400)] <ecochran> return newString;
[15:07:15 EDT(-0400)] <ecochran> };
[15:07:36 EDT(-0400)] <ecochran> no, these are really good questions!
[15:11:20 EDT(-0400)] <michelled> I wonder if there's someone in the sakai community we could ask. What you've written looks useful. I do want us to think a bit about whether it's going to cause us more head ache later when we get translated strings.
[15:12:46 EDT(-0400)] <michelled> I imagine that if the original template has: %0 blah %1 and a translation would be: blah %1 that passing in an empty string for %0 would be just fine.
[15:26:44 EDT(-0400)] <ecochran> yes
[15:27:13 EDT(-0400)] <ecochran> michelled: yes, sorry, stepped away for a moment
[15:27:30 EDT(-0400)] <michelled> np
[15:43:10 EDT(-0400)] * apetro-_ (n=apetro@wsip-98-174-242-39.ph.ph.cox.net) has joined #fluid-work
[16:06:33 EDT(-0400)] * phiggins (n=dante@c-68-34-199-67.hsd1.tn.comcast.net) has joined #fluid-work
[16:06:33 EDT(-0400)] * theclown_afk (n=theclown@142.150.154.101) has joined #fluid-work
[16:31:50 EDT(-0400)] * jensmh (n=jensmh@128.189.220.2) has joined #fluid-work
[16:42:14 EDT(-0400)] * jensmh (n=jensmh@128.189.220.2) has left #fluid-work
[17:33:47 EDT(-0400)] * theclown_afk (n=theclown@142.150.154.101) has left #fluid-work
[17:42:19 EDT(-0400)] * apetro-_ (n=apetro@wsip-98-174-242-39.ph.ph.cox.net) has joined #fluid-work
[20:19:37 EDT(-0400)] * phiggins (n=dante@c-68-34-199-67.hsd1.tn.comcast.net) has joined #fluid-work
[21:40:39 EDT(-0400)] * colinclark (n=colin@bas1-toronto09-1279543604.dsl.bell.ca) has joined #fluid-work
[21:50:26 EDT(-0400)] * phiggins (n=dante@c-68-34-199-67.hsd1.tn.comcast.net) has joined #fluid-work
[23:09:45 EDT(-0400)] * colinclark (n=colin@bas1-toronto09-1279543604.dsl.bell.ca) has joined #fluid-work
Unknown macro: {String}
Unknown macro: {array}
Manage space
Manage content
Integrations