Opened 16 years ago
Closed 16 years ago
#15124 closed defect (bug) (fixed)
Script concatentation breaks l10n of javascript output in head
| Reported by: | macbrink | Owned by: | westi |
|---|---|---|---|
| Priority: | high | Milestone: | 3.1 |
| Component: | JavaScript | Version: | 3.0.1 |
| Severity: | major | Keywords: | convertentities, i18n, has-patch, needs-improvement |
| Cc: | Focuses: |
Description
This is what I find in the Admin header:
try{convertEntities(quicktagsL10n);}catch(e){};
/* ]]> */
</script>
<script type='text/javascript' src='http://myserver/wp/wp-admin/load-scripts.php?c=1&load=jquery,utils,quicktags&ver=b50ff5b9792a9e89a2e131ad3119a463'></script>
convertEntities() is called before the actual script has loaded.
This is quite annoying while debugging other scripts in firebug.
Change History (19)
#4
@
16 years ago
- Resolution fixed
- Status closed → reopened
Running WordPress 3.1-alpha with the patch.
Firebug breaks on error because
try{convertEntities(swfuploadL10n);}catch(e){};
is called before the utils javascript has loaded at opening the New Media screen.
#5
@
16 years ago
- Summary Convertentities called before script has loaded → Script concatentation breaks l10n of javascript output in head
Re-titling.
I think we need a better solution than just grouping everything in the footer.
#8
@
16 years ago
I really want to rewrite the Script loader and make it support grouping properly rather than the way it works at the moment.
But that is not something to do at this point in the cycle.
So I'm going to do something creative in that direction for now.
#13
@
16 years ago
- Resolution fixed
- Status closed → reopened
<script type='text/javascript' src='http://wp.local/wp-includes/js/l10n.dev.js?ver=20101110'></script> <script type='text/javascript' src='http://wp.local/wp-includes/js/l10n.dev.js?ver=20101110'></script>
Without SCRIPT_DEBUG:
<script type='text/javascript' src='http://wp.local/wp-includes/js/l10n.js?ver=20101110'></script> <script type='text/javascript' src='http://wp.local/wp-admin/load-scripts.php?c=1&load=jquery,utils&ver=7bb5fde83e0949a753f31e184d1c6ac7'></script> <script type='text/javascript' src='http://wp.local/wp-includes/js/l10n.js?ver=20101110'></script>
Once too often.
#15
@
16 years ago
Any reason why we'd need to always output on Non-Admin (i.e: Themes) in the header?
<script type='text/javascript' src='http://dev.site.com/wp-includes/js/l10n.js?ver=20101110'></script>
Like myself many theme developer would appreciate if this was disabled by default and API to enable it for those needed.
#17
follow-up:
↓ 18
@
16 years ago
azizur:
The reason is, that it's needed by the admin bar, see:
$scripts->localize( 'admin-bar', 'adminBarL10n', array(
'url' => __( 'URL:' ),
'noShortlink' => __( 'No shortlink available for this page.' ),
'l10n_print_after' => 'try{convertEntities(adminBarL10n);}catch(e){};',
) );
#18
in reply to: ↑ 17
@
16 years ago
Replying to ocean90:
azizur:
The reason is, that it's needed by the admin bar, see:
$scripts->localize( 'admin-bar', 'adminBarL10n', array( 'url' => __( 'URL:' ), 'noShortlink' => __( 'No shortlink available for this page.' ), 'l10n_print_after' => 'try{convertEntities(adminBarL10n);}catch(e){};', ) );
I suspect we may output it as the only js as well because of the way it works at the moment.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [15814]) Group the quicktags js. Fixes #15124.