如何本地化数据源的路径?(How to localize path to data source?)
我想本地化一个从CSV文件中提取数据的应用程序。
let location = Bundle.main.path(forResource: "CSV", ofType: "txt")
我有其他CSV文件具有相同的数据,但翻译成其他语言。 我发现如何本地化字符串,但我怎样才能本地化数据源的位置?
I want to localize an app that pulls data from a CSV file.
let location = Bundle.main.path(forResource: "CSV", ofType: "txt")
I have other CSV files with the same data but translated into other languages. I found how to localize strings but how can I localize location of data sources?
原文:https://stackoverflow.com/questions/47108529
最满意答案
这可能是你正在寻找的。 我假设您有一些要切换的链接类,所以您应该将它添加到选择器中,这样您就不会选择所有链接,但这会从所有内容中删除活动类,然后将其添加回只有那些rel属性就是你从地图中抓取的东西。
var active = 'something'; $('a').removeClass('active').filter('a[rel^="'+active+'"]').addClass('active');
This may be what you're looking for. I'm assuming you have some class of the links you want to toggle, so you should probably add that to the selector so you're not selecting all links, but this removes the active class from everything and then adds it back to only those with the rel attribute being what you've grabbed from the map.
var active = 'something'; $('a').removeClass('active').filter('a[rel^="'+active+'"]').addClass('active');
相关问答
更多-
使用rel =“next”rel =“prev”HTTP标头的分页SEO(SEO of Pagination using rel=“next” rel=“prev” HTTP Headers)[2023-11-02]
Maile Ohye回答了这个问题 。 @estrik:我们在HTTP标头中支持rel =“next”和rel =“prev”。 例如,对于文章的page = 2,您可以使用HTTP标头进行响应: 链接: http : //www.example.com/article ?story = abc& page = 1 ; 的rel = “PREV” 链接: http : //www.example.com/article ?story = abc& page = 3 ; 为rel = “下一步” This w ... -
rel = canonical链接是否从页面中删除所有SEO值?(Does a rel=canonical link remove all SEO value from the page?)[2020-08-25]
在大多数情况下,你的问题的答案是“是”。 关于Google - GoogleAnswers (请参阅最后一个问题)。 其他搜索引擎不能保持此属性。 问候。 In most cases the answer on your question is "yes". With regard to Google - GoogleAnswers (see the last question). Other search engines can not maintain this attribute. Regards. -
我可以从html中的link元素中省略rel属性吗?(Can I leave out the rel attribute from a link element in html?)[2022-05-21]
我不确定我是否真的得到你的问题。 我可以从html中的link元素中省略rel属性吗? 简短的回答,当然! 您可以使用rel属性,但您不必使用! 这几乎是您为html文件添加有效链接所需的全部内容。 I link to Google I'm not sure if I really get your problem. Can I leave out the rel attribute from a link element in ht ... -
web2py将插入标题(web2py insert into header)[2023-08-08]
一个选项是在layout.html视图的head部分中创建一个块: {{block canonical}}{{end}} 然后在您要设置规范链接的任何视图中: {{block canonical}} {{end}} 一个更简单的选择是在layout.html的头部包含以下内容: {{if response.canonical:}} ... -
这些网址被允许是相对的。 这通常适用于href属性。 例如,相同的链接标签用于包括样式表,样式表也可以使用相对URL来包含。 根据Mozilla的说法 HREF 此属性指定链接资源的URL。 URL可以是绝对的或相对的。 Those urls are allowed to be relative. This applies to the href attribute in general. The same link tag is used for instance to include style she ...
-
所以你需要比较主机,这样的东西应该工作。 a : function( element ) { if ( element.host !== window.location.host ) { element.attributes.rel = 'nofollow'; } } I solved it like; CKEDITOR.on('instanceReady', function(ev) { var editor = e ...
-
这可能是你正在寻找的。 我假设您有一些要切换的链接类,所以您应该将它添加到选择器中,这样您就不会选择所有链接,但这会从所有内容中删除活动类,然后将其添加回只有那些rel属性就是你从地图中抓取的东西。 var active = 'something'; $('a').removeClass('active').filter('a[rel^="'+active+'"]').addClass('active'); This may be what you're looking for. I'm assuming ...
-
Yoast插件有自己的过滤器,哪些广告是规范链接到wp标题的。 要禁用它,请在functions.php中尝试此操作 add_filter( 'wpseo_canonical', '__return_false' ); Yoast plugin has its own filter which ads that canonical link to wp header. to disable it try this in your functions.php add_filter( 'wpseo_canon ...
-
虽然上面的代码添加了备用链接( rel="alternate" ),但验证器也想要一个指向原始源的链接( rel="self" )。 因此,添加以下代码解决了问题。 string feedUrl = string.Format("{0}/Syndication/Atom", UrlBuilder.GetUriRoot(uri)); // Add feed (self) URL var link = new SyndicationLink(new Uri(feedUrl)); link.Relationsh ...
-
在我的joomla模板中添加(Adding a in my joomla template)[2022-05-08]
$ this指的是插件的上下文,而在模板$中这是模板,因此是错误。 我在很长一段时间内没有使用过1.5,但考虑到系统插件可以访问生成的标记; 所以它可以插入任何操纵html文本的标签。 但是,它需要访问组件的数据才能获得图像。 但该组件在插件之前运行,因此您可以在组件中设置post var或global: JRequest::setVar('templateheader',$this->item->image); 然后在系统插件或libraries / joomla / document / html / ...