众所周知,当我们点击TAB键盘上的键时,它允许我们浏览当前打开的网页上的所有活动的href链接.是否可以通过JavaScript读取这些网址?
例:
function checkTabPress(key_val) {
if (event.keyCode == 9) {
// Here read the active selected link.
}
}
Run Code Online (Sandbox Code Playgroud) 我是Symfony2的新手.试图建立翻译服务.我遵循官方文档中给出的步骤.但没有成功.
以下是步骤
在"symfony/app/config/config.yml"翻译服务中定义语言环境 "#translator:{ fallback: %locale% }"
在'symfony/app/config/parameters.yml'定义的区域设置参数中"locale:de"
在'src/MyBundle/translateBundle/Resources/translations/messages.de.xlf'创建中
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>Symfony2 is great</source>
<target>J'aime Symfony2</target>
</trans-unit>
</body>
</file>
</xliff>
Run Code Online (Sandbox Code Playgroud)现在我希望这个编码现在我应该得到:'J'aime Symfony2'执行下面的代码.
<?php
namespace MyDays\translateBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller {
public function indexAction() {
$t = $this->get ( 'translator' )->trans ( 'Symfony2 is great' );
return new Response ( $t );
}
}
Run Code Online (Sandbox Code Playgroud)
但仍然把原始文本称为'Symfony2很棒'!除了文档中给出的步骤之外,还有什么必须做的吗?
有人知道对于Symfony2而言,只需很少的修改就能生成用于Sitemap的优秀供应商捆绑包。
symfony ×2
bundle ×1
javascript ×1
replace ×1
service ×1
sitemap ×1
smarty ×1
string ×1
translation ×1