Answers.Body: <p>Good question... As far as I know, the plugin's resource paths <strong>should not</strong> include the localization prefix. The resources are being called via PHP in the most direct way possible:</p>
  
  <pre><code>craft()-&gt;templates-&gt;includeJsResource('smartmap/js/smartmap.js');
  craft()-&gt;templates-&gt;includeCssResource('smartmap/css/smartmap.css');
  </code></pre>
  
  <p>I'm not entirely sure, but I suspect this may be a Craft bug. I've reached out to Pixel &amp; Tonic in order to fully diagnose the problem. If the plugin code needs to be corrected, I will implement a fix as soon as we can figure out what's going on.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-05T09:26:12.523Z
Answers.LastActivityDate: 2014-07-05T09:26:12.523Z
Answers.UserDisplayName: Lindsey D
Answers.Body: <p>When Craft generates a “resource URL” from a front-end request, it just takes whatever the current site URL is, adds the <a href="http://buildwithcraft.com/docs/config-settings#resourceTrigger" rel="nofollow">resourceTrigger</a> config setting (“cpresources”), and then adds the path that was passed in (“smartmap/js/smartmap.js” for example).</p>
  
  <p>So if your site URL is “/en”, then that’s going to be part of the resulting resource URL.</p>
  
  <p>As long as there’s a working Craft index.php file at /en/index.php, and you’re able to serve regular front end pages from that base URL, then there’s no reason the “en/” part should be tripping anything up when serving resources.</p>
  
  <p>All of the CP’s front-end resources are served through the same mechanism – try going to /en/admin (or whatever your <a href="http://buildwithcraft.com/docs/config-settings#cpTrigger" rel="nofollow">cpTrigger</a> is set to) and seeing if the CP is working normally from there.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-06T14:32:38.550Z
Answers.Text: Nope, blank page
Answers.UserDisplayName: maunoxyd
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-06T14:52:48.737Z
Answers.Text: In that case the issue is bigger than just a couple of plugin resource URLs. We can help you look into it if you send the URLs and FTP credentials over to support@buildwithcraft.com (and include this page's URL for reference).
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-06T13:30:34.787Z
Answers.LastActivityDate: 2014-07-06T13:30:34.787Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>I'm using Craft in a multilingual setup with the Smart Map plugin. However, the CSS and JavaScript files are not being linked properly when the site isn't in the main language.</p>
  
  <p>For some reason, the paths to the plugin resources contain the language prefix:</p>
  
  <pre><code>/en/cpresources/smartmap/css/smartmap.css
  </code></pre>
  
  <p>Is this normal behaviour? How can it be fixed?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-07-06T04:21:38.613Z
Comments.Text: Let me ask you this... **Do you have any other plugins that have built-in CSS or JS?** If so, are those other plugins experiencing the same problem? I'm just trying to diagnose if the issue is on the Craft side or the Smart Map side.
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-07-06T09:07:46.920Z
Comments.Text: I have only smartmap and contact form plugin. Contact form plugin doesn't seem to require js or css
Comments.UserDisplayName: maunoxyd
Tags: <plugin-smartmap><localization>
Title: Why do the plugin resource paths include the localization prefix?
ThreadText: # Why do the plugin resource paths include the localization prefix?
  
  (Asked by: username_0 on 2014-07-05)
  
  I'm using Craft in a multilingual setup with the Smart Map plugin. However, the CSS and JavaScript files are not being linked properly when the site isn't in the main language.
  
  For some reason, the paths to the plugin resources contain the language prefix:
  
  ```
  /en/cpresources/smartmap/css/smartmap.css
  
  ```
  
  Is this normal behaviour? How can it be fixed?
  
  **Tags:** plugin-smartmap, localization
  
  > **Comments:**
  > **username_1**: Let me ask you this... **Do you have any other plugins that have built-in CSS or JS?** If so, are those other plugins experiencing the same problem? I'm just trying to diagnose if the issue is on the Craft side or the Smart Map side.  
  > **username_0**: I have only smartmap and contact form plugin. Contact form plugin doesn't seem to require js or css  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-07-05. Score: 2 | Accepted answer
  
  Good question... As far as I know, the plugin's resource paths **should not** include the localization prefix. The resources are being called via PHP in the most direct way possible:
  
  ```
  craft()->templates->includeJsResource('smartmap/js/smartmap.js');
  craft()->templates->includeCssResource('smartmap/css/smartmap.css');
  
  ```
  
  I'm not entirely sure, but I suspect this may be a Craft bug. I've reached out to Pixel & Tonic in order to fully diagnose the problem. If the plugin code needs to be corrected, I will implement a fix as soon as we can figure out what's going on.
  
  
  ---
  
  ### Answer by username_2 on 2014-07-06. Score: 2
  
  When Craft generates a “resource URL” from a front-end request, it just takes whatever the current site URL is, adds the [resourceTrigger](http://buildwithcraft.com/docs/config-settings#resourceTrigger) config setting (“cpresources”), and then adds the path that was passed in (“smartmap/js/smartmap.js” for example).
  
  So if your site URL is “/en”, then that’s going to be part of the resulting resource URL.
  
  As long as there’s a working Craft index.php file at /en/index.php, and you’re able to serve regular front end pages from that base URL, then there’s no reason the “en/” part should be tripping anything up when serving resources.
  
  All of the CP’s front-end resources are served through the same mechanism – try going to /en/admin (or whatever your [cpTrigger](http://buildwithcraft.com/docs/config-settings#cpTrigger) is set to) and seeing if the CP is working normally from there.
  
  > **Comments:**
  > **username_0**: Nope, blank page  
  > **username_2**: In that case the issue is bigger than just a couple of plugin resource URLs. We can help you look into it if you send the URLs and FTP credentials over to support@buildwithcraft.com (and include this page's URL for reference).  
  
  ---
  
  