<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>312967</bug_id>
          
          <creation_ts>2026-04-21 23:24:31 -0700</creation_ts>
          <short_desc>Two adjacent placeholders for the i18n replacement are wrongly replaced.</short_desc>
          <delta_ts>2026-04-22 07:03:04 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Extensions</component>
          <version>Safari 26</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 26</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kanaru Sato">i.am.kanaru.sato</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2203056</commentid>
    <comment_count>0</comment_count>
    <who name="Kanaru Sato">i.am.kanaru.sato</who>
    <bug_when>2026-04-21 23:24:31 -0700</bug_when>
    <thetext>Named placeholder substitution in WebExtensions localization (`i18n.getMessage`) fails when two placeholders are adjacent.

Step to reproduce:

- set a message in messages.json as follows:

```
  &quot;adjacent_named&quot;: {
    &quot;message&quot;: &quot;$prefix$$suffix$&quot;,
    &quot;placeholders&quot;: {
      &quot;prefix&quot;: { &quot;content&quot;: &quot;$1&quot; },
      &quot;suffix&quot;: { &quot;content&quot;: &quot;$2&quot; }
    }
  }
```

- Then call like this from JavaScript.

```
const args = [&quot;3&quot;, &quot;4&quot;];
console.log(browser.i18n.getMessage(&quot;adjacent_named&quot;, args));
```

Expected Result:

- it shows `34`.


Actual result:

- it shows `3$SUFFIX$`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2203057</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-04-21 23:24:37 -0700</bug_when>
    <thetext>&lt;rdar://problem/175315700&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2203058</commentid>
    <comment_count>2</comment_count>
    <who name="Kanaru Sato">i.am.kanaru.sato</who>
    <bug_when>2026-04-21 23:25:15 -0700</bug_when>
    <thetext>See also: https://github.com/WebKit/WebKit/pull/62313</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2203161</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-22 07:03:02 -0700</bug_when>
    <thetext>Committed 311769@main (9d2313b02b23): &lt;https://commits.webkit.org/311769@main&gt;

Reviewed commits have been landed. Closing PR #63298 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>