Patchwork: content strings in css aren't i18n'd

Created on 13 Feb 2019  ·  5Comments  ·  Source: ssbc/patchwork

In trawling source, I found https://github.com/ssbc/patchwork/blob/master/styles/light/compose.mcss#L49 wherein we embed content via CSS. This means, I believe, that the content won't be translated.

stale i18n bug

Most helpful comment

Oh, look what i found:

dark/compose.mcss:

Compose {
  section.actions {
    input[type=file] {
      ::before {
        content: 'Attach';
      }
    }
}

light/compose.mcss:

Compose {
  section.actions {
    input[type=file] {
      ::before {
        content: '📎 Attach File'
      }
    }
  }
}

So it’s not just a translation problem, but an inconsistency between themes, too.

All 5 comments

Still looking for a solution to this issue, unfortunately it doesn't look like we can give input elements custom text so this is the hack we're stuck with. Maybe we should be using a button or something instead? Or a <label>, honestly, would be the idiomatic way to do this.

In this specific case (i havenʼt checked others yet) itʼs easy to switch this ::before “element” to a proper label. I wonder why it was done this way…

Oh, look what i found:

dark/compose.mcss:

Compose {
  section.actions {
    input[type=file] {
      ::before {
        content: 'Attach';
      }
    }
}

light/compose.mcss:

Compose {
  section.actions {
    input[type=file] {
      ::before {
        content: '📎 Attach File'
      }
    }
  }
}

So it’s not just a translation problem, but an inconsistency between themes, too.

Here is the full list i found on master:

$ ag 'content:'  # Irrelevant lines are filtered out from the below results
base/loading.mcss
37:      content: 'Loading...'
49:      content: 'Searching...'

base/message.mcss
49:            content: ' unread'
54:            content: ' new'
97:          content: 'private'

dark/compose.mcss
35:        content: 'Attach'

light/compose.mcss
49:        content: '📎 Attach File'

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gaffen picture Gaffen  ·  4Comments

adamnovak picture adamnovak  ·  6Comments

nicohansi picture nicohansi  ·  8Comments

mmckegg picture mmckegg  ·  4Comments

mmckegg picture mmckegg  ·  6Comments